fixing generateRawData and generateFile()