fixes for event handling