Fixed the file was not generated when the print option is specified