fix redirection bug