How can I sort user history?