fixing undo/redo and test