
334 So.2d 897 (1976)
SPARKS CONSTRUCTION COMPANY, INC.
v.
GENERAL MUTUAL INSURANCE COMPANY, etc., et al.
SC 1506.
Supreme Court of Alabama.
June 18, 1976.
Rutledge & Pruett, Gadsden, for appellant.
Dortch, Wright & Ford, Gadsden, for General Mut. Ins. Co.
Jack Floyd, Gadsden, for Donald F. Rogers.
SHORES, Justice.
Cecil Dorsett filed an action in the Circuit Court of Etowah County against Sparks Construction Company, Inc., claiming damages resulting from its negligence. Sparks Construction Company filed a third-party complaint against Donald F. Rogers claiming indemnity based upon a subcontract agreement between Sparks Construction and Rogers. Subsequently, General Mutual Insurance Company, which had issued a policy to Rogers, filed a bill for declaratory judgment, which is the subject of this appeal. The complaint sought a declaration that (1) the insurer was not obligated by the terms and provisions of the policy to defend Rogers, and (2) that the insurer was not obligated to indemnify Rogers against loss due to the terms and provisions of the subcontract. Each defendant (Rogers, Dorsett and Sparks) filed *898 answers and Dorsett, in addition, counterclaimed against General Mutual asserting that he was a third-party beneficiary of the contract of insurance between General Mutual and Rogers.
The trial court determined that the indemnity provision in the contract between Sparks and Rogers was not broad enough as to require Rogers to indemnify Sparks, and that the parties to the agreement did not intend that Rogers should indemnify Sparks for loss occasioned by Sparks' own negligence. The court then found the issues presented by the declaratory judgment action were moot and dismissed the bill. At the same time, the court dismissed the third-party complaint filed by Sparks against Rogers.
Sparks appealed from this judgment and contends that the dismissal of the thirdparty complaint was never requested, that it was unrelated to the issues presented by the instant complaint, which only sought a declaration of the obligations under the policy of insurance issued by General Mutual to Rogers, and thus should not have been dealt with by the trial court in its judgment.
General Mutual counters, saying that the question of whether Rogers was being sued for a legally enforceable contractual obligation was the primary question the court had to resolve to determine the issues presented by the declarator judgment action, although it admits that this issue was not raised in its bill; but says that, under Rule 54(c), ARCP, it is the duty of the court to grant the relief to which a party is entitled irrespective of the prayer for relief in the pleadings.
General Mutual points out that the declaratory judgment action contained a general prayer for relief.
General Mutual also argues that, while a party may contractually agree to indemnify another for the consequences of the other's negligence, the language of such an agreement must be clear and unambiguous; that the ambiguity in the instant case justified the trial court's consideration of parol evidence to arrive at the intent of the parties; and that the findings of the trial court should not be disturbed unless clearly erroneous or manifestly unjust.
Rogers argues that it was entirely proper for the trial court to hold that the indemnity provision of the subcontract was invalid and, by so doing, rendered the question of coverage presented by General Mutual in the declatory judgment action moot.
The issue dispositive of this case is whether the trial court erred in dismissing the declaratory judgment action and granting the relief afforded in the last paragraph of its judgment:
"IT IS FURTHER ORDERED, AJUDGED, DECREED AND DELARED BY THE COURT that based on the above findings of Fact and Declarations of this Court, the Third-Party Complaint filed by the Defendant Sparks against the Defendant Rogers in Civil Action # 19,653 on the law side of this Court, is due to be dismissed."
We note than an order was made in an attempt to modify the judgment, but the order was void as it was made beyond 90 days from the date of the judgment. ARCP 59.1.
The trial court determined that the indemnity provision of the contract between Rogers and Sparks Construction was the dispositive issue in the declaratory judgment action. Upon resolving that issue against Sparks Construction, the court dismissed the third-party action in the pending litigation filed by Dorsett against Sparks.
General Mutual says in brief:
"At first it was not apparent to General Mutual as to whether or not the determination reached by the trial court was in favor of or contrary to the interest of General Mutual. But now, on further recollection, it is apparent that General *899 Mutual was mistaken in the specific relief prayed for, and that the validity or nonvalidity of the indemnity contract provision upon which the third-party action was founded was the initial issue. And, irrespective of the dismissal of the declaratory judgment action, the adjudication of the indemnity contract provision between Sparks and Rogers by the trial court does in fact make a declaration of rights and legal relations of all the parties to this litigation." (Emphasis Supplied)
It is not disputed that the validity or nonvalidity of the indemnity provision in the subcontract between Sparks and Rogers was central to the third-party complaint pending at the time this action was filed. General Mutual did not seek a declaration of rights under that provision. It merely sought a determination of whether it was required to defend its insured under the terms of its policy. The court did not make that determination, but, instead, dismissed the complaint in the declaratory judgment action concluding that, the indemnity provision being invalid, the insurance question was therefore moot. The court erred in dismissing the complaint in the declaratory judgment action. Whether General Mutual is bound to defend Rogers in the suit on the indemnity provision depends upon what its policy provides. The policy may exclude coverage to Rogers even though he may have incurred liability by virtue of the subcontract provision. General Mutual may owe its insured a defense in that action even though it is ultimately determined that the indemnity provision is insufficient to impose liability upon Rogers. None of these issues have been determined; and we cannot agree with the trial court that they are moot.
Had the court been asked, in the declaratory judgment action, to determine the validity of the indemnity agreement between Rogers and Sparks Construction, the court would have been wrong in doing so since this issue was pending at the time of the declaratory judgment action in the third-party action involving the same issue between Rogers and Sparks Construction. See Foreman v. Smith, 272 Ala. 624, 629, 133 So.2d 497 (1961). In Auto Mut. Indemnity Co. v. Moore, 235 Ala. 426, 429, 179 So. 368, 370 (1938), this court observed that ". . . We have never held that after another suit has been begun, if it affords an adequate judicial determination of the question, a suit for a declaratory judgment may supersede it, and withdraw from that suit a decision of the question." A declaratory judgment act is not designed to resolve the rights involved in a pending suit. Annot., 135 A.L.R. 934, 936 (1941). To permit otherwise would sanction the use of the declaratory judgment act as a vehicle to determine the sufficiency of defenses to a pending action.
Rule 54(c), ARCP, does not demand the affirmance of this case, since neither General Mutual nor Rogers was entitled to have the validity of the indemnity provision determined in this action, and obviously neither was entitled to a dismissal of Sparks' third-party complaint.
The issues of coverage and defense, therefore, are not moot; and this case must be reversed and remanded for the resolution of those issues by the trial court. Since we have held validity or nonvalidity of the indemnity provision was not before the trial court, it follows that that issue is not before this court.
REVERSED AND REMANDED.
HEFLIN, C.J., and MADDOX, JONES, and BEATTY, JJ., concur.
