clean up state transition