Fixed the eventlistener to work when passing in a parameter