Set max retry value to avoid program hangup.