update thresholding