hotfix regarding writing histogram