fix the sort problem