fixed bug with thresholdsearch when Nh > 1