isValidTransition returns unexpected string output. Changed check in transitionTo.