fixed segmentation fault in histogram class