bugfix for thresholds