refactored refactoring of refactoring
fixed error in eventlistener