Finally fixed the sorting of the collection