fixed bug with histograms