handling events better