fix undo (ctrl-z)