Corrected typo in sorting