bug fix with histogram