Ensure that new state is set before processing the state transition