fix histogram bug