fixed the event dispatch