Fixed the file generation