fixed errors generating files when the_path==''