fix sort method