improved event dispatching