Added the ability to register for events