You should set a new variable called ``output_dir`` rather than continuing to interact with the ``opts`` member variable. On line 57, I would add:

```
output_dir = opts.output_dir
```

and then work with ``output_dir`` from there.