Build the retry mechanism