Fixes how eventlistener functions are called