rewrite window.location