Dow Jones leads the way as US stocks close with gains