Made sort_query support multiple columns