changed the way error-hists are built