fix undo/redo