fixing sorting order.