Added event dispatching.