fixed some threshold stuff