deprecated changeState to handleStateEvent.
changeState to take in a state.