Undo feature fixed for sort