Added an event manager and set it up to work in main.