fixing undo! and redo! methods