support to write histograms to file added