threshold bug fix, unit bug fix