Fix endUpdates sort issue