window.on no longer exist. Corrected the listeners