Fixed duplicates in UI after sorting.