add Retry middleware for retrying failed requests