threshold bug fix