fixed bugs, closure works for multople hists