Corrected bug in saving results to correct folder