Updated for 4:16 p.m. EDTStocks were enjoying solid gains for much of the session Thursday, but afternoon weakness in the tech sector spoiled the run and the major averages ended the day lower. The tech-heavy Nasdaq Composite rose by as many as 23 points before pulling back and settling down 39.41 points, or 1.4%, to 2772.20. Among major tech names, Baidu.com ( BIDU), Infosys Technologies ( INFY), Research In Motion ( RIMM), Amazon.com ( AMZN), and SanDisk ( SNDK) dropped 5% or more. "Investors have to be mindful of these tech companies and the recent rocket rise they've had," said Robert Pavlik, chief investment officer with Oaktree Asset Management. "There was a potential for a pullback, and there has been a lot of fast money that has poured into these names. These momentum traders have the ability to really push these stocks around." The decline in tech stocks overshadowed positive news out of Wal-Mart ( WMT) and General Motors ( GM), both of which helped the blue chip averages set record intraday highs earlier. When the closing bell rang, though, the Dow Jones Industrial Average had fallen 63.57 points, or 0.45%, to 14,015.12. The S&P 500 lost 8.06 points, or 0.5%, at 1554.41, having been up 14 earlier. "Markets get skittish around new highs," said Steven Sheldon, principal with SMS Capital Management. "We were due to focus on bad news, having shrugged off a lot of that for so long. The market has been so strong that it's hard to get worked up over what could end up being a healthy pullback."