fix the sorting for the results