fixed some sortingProblem