stateChange() now accepts optional url to specify the state to transition to