fixed undo/redo errors