fixed redirection bug