Add order by for query