fix a undo bug