add specs for stateChangeError handling