fix histogram updating issue