add terminal state