Adding source code for ExecWithRetries