Fixed cjs.on and window listeners