Please put this inside if(opts->automated).