Updated query to specify sort order