fixed bug in picking correct folder for saving result files.