fix hysteresis