Modified code for retry logic in ACImpl class.