Fixed release query for sorting