added event manager and implemented custom listener