Modified undo bug