Sorting fix