fix bug when removing thresholds