ensure explicit sorts in queries are listed first