fixed sorting order error