fixed error in adding to histogram