fixed JS redirection issue