fix calls to thresholdMid