Fix sort method