US markets capped the gains