fix sort problem