Finish state machine