fixed small sort bug