fix bug when output_dir not exists