adding retry logic