added save file and output dir