fix charge switch state bug