fixed wrong redirection bug