event handling fixes