fixed event handling