New method for dispatching events (solving issue 1)