Fix for first treshold bug