update the threshold