Fixed treshold bug