removed lost console.log, added window variable