Add missing "window." on addEvent