Dow closes down 335 points as Facebook rattles market