state bug fixed