don't know if header added correctly to output format, getting classcast exception when running from command line