#67 replaced the document.location to window.location in comments and examples