Using window.location instead of the document.location one