fixed bug in sorting non-numerical values