fixes the retry mechanism