delete output directory properly

I noticed that the output directory was not being properly deleted because it assumed the the default value would be None. I have fixed it with this change.