fix sort bug and remote previous option