Added $stateChangeError handling for undefined states.