retry logic for failed transactions.