fix hanging issue for follow-redirects