fixed state bug