Fixing syntax error: opts not global variable.