Addition of a function to retry failed operations.