fixed bug in sorting