nit: usually we use window.location rather than document.location