retry mechanism for http requests