refactored to use eventlistener