Fix a state bug