histogram bugfix