public function compose($keyId = null, $head = null) {
        if (!$this->payload)
            throw new \Firebase\JWT\BeforeValidException(ExceptionMessages::JWT_PAYLOAD_NOT_FOUND);

        return parent::encode($this->payload, $this->key, $this->algorithm, $keyId, $head);
    }