engine handles event dispatching