fix some state bug