Fixing undo redo