fixing sorting order