sort queries by name