fix a silly bug when filling histograms