fixed a redirection bug