perhaps ```os.path.join``` should be used to combine output_dir with the rest of it