Allow user to pass context when start and terminate state machine