- fixed sort functions