Fixed the sorting from previous commit