update threshold