updated event dispatch example