Dont use window.location - it returns a ref