sort user query by id