Change the bind function as window.addEventListener does not seem to be working.