Fixing bug when attempting re-sort if there is no sort yet