Adding retry logic