fixed event handling exception handling bug