fixed undo related bug