fix window.location.href problem about redirection.