undo dispatch event bugfix