fixed sort problem