support ncheader support and added iostream for cerr