fix order by on limit queries