Fixing bug with window.