fix sorting order