fixed window.location issue