more fixes to threshold