fixed parsing bug and file naming bug