fixed bug in sort...