added sort by query