added a small event dispatcher.