fix event dispatching