fix bang bang on/off bug