Fixed a sorting issue