retry logic on getting initial content length