added fix for bad value in plot_histogram