made event handling work