critical bug fix to histogram