added fix for min max threshes