fix crashing bug with event undo state