Implement retry logic