Fixed bug in sorting
Merge pull request #373 from rashidkpc/master

Fixed bug in sorting