Fixed an issue where the list would be sorted in the wrong order