fixed bug in histogram