fix undo then redo crash