some more proper event handling