bug in window.location fixed