small bugfix in undo mode