state bug fix