Dow, S&P close lower, pulling back from record highs