protected function addCaptchaElement()
    {
        if (!$this->getCaptchaOptions() || $this->has('captcha')) {
            return;
        }

        $spec = array_replace_recursive($this->captchaElementSpec, [
                'name' => $this->getCaptchaElementName(),
                'options' => [
                    'captcha' => $this->getCaptchaOptions(),
                ],
            ]);

        $this->add($spec, ['priority' => -970]);
    }