more fixes to state transition to make more seamless.