OPINION OF THE COURT
In this сase a pharmaceutical manufacturer’s claim for indemnity against its excess products liability insurer rests on the theory that a hospital is also insured under the same policy. Once that fact is established, the manufacturer contends it is entitled to a credit against its self-insured retention for the amount the hospital contributed to the multi-party settlement of a patient’s injury. Differing with the district court, we conclude that the hospital comes within the scope of a vendor’s endorsement to the policy. That leads to a second question, whether the hazard insured against includes responsibility for an excessive dosage to the patient. The answer depends on whether the hospital itself was negligent or whether it was only secondarily liable as the seller of a defective product. We will remand to the district court for findings on those factual issues as well as those on the manufacturer’s claim for costs of defense.
The district court entered summary judgment for the defendant insurance company on two of three claims in the complaint, certifying the two under Fed.R.Civ.P. 54(b), and leaving the оther for resolution at a later stage.
The dispute grows out of the settlement of a personal injury suit. While a patient in the St. Francis Hospital in Wilmington, Delaware, an eleven month-old infant, Thomas M. Keys, received an overdose of a pharmaceutical manufactured by Cooper Laboratories, Inc., plaintiff in this case. The child suffered permanent injuries, and his parents brought suit in the Delaware state court in 1979. Ultimately, the list of defendants included the hospital, Doctors McReynolds and Lynam (the attending physicians), and Cooper Labоratories.
The physicians were alleged to have negligently prescribed dosages which were excessive for an infant. The hospital was said to be vicariously at fault for the conduct of its nurses in failing properly to monitor the child’s condition. In addition, the hospital pharmacist was charged with negligence in filling the prescriptions without recognizing that the dosages were inappropriate for the patient. Cooper Laboratories was cited for using a misleading label that failed to alert users to the difference in potency between two similarly named pharmaceuticals, elixophyllin pediatric suspension and elixophyllin elixir. Finally, Cooper was charged with having failed to provide sufficient warnings through inserts, advertisements, or notifications.
*670 The case was settled during trial for the sum of $1,900,000, contributions being made by the parties as follows:
Cooper Laboratories $950,000.00
St. Francis Hospital 300,000.00
Dr. Lynam 450,000.00
Dr. McReynolds 200,000.00
International Surplus Lines Insurance Company (ISLIC), defendant here, had issued to Cooper Laboratories a products liability policy which was excess to a one million dollar retention by the insured. Included was a vendor’s endоrsement, extending protection to those who distributed or sold a Cooper product in the course of their business. The policy also contained a clause stating that the carrier had “the right and duty to defend” suits against the insured.
ISLIC received its first notice of the child's claim and suit in March 1982, one month after Cooper’s attorneys had received a settlement demand of $8,500,000. They kept the insurance company informed throughout the negotiations, which continued until settlement during trial on February 10,1983. On January 28, 1983, Cooper advised ISLIC that it would be held responsiblе for the cost of defense and that the doctors and hospital were additional insureds who were covered by the vendor’s endorsement.
When ISLIC refused to pay any part of the settlement or defense costs, Cooper filed this suit in the federal district court in New Jersey, the state in which the company’s principal place of business was located. The complaint charges that the carrier unjustifiably refused to defend the personal injury suit or contribute to its settlement and that ISLIC badgered Cooper into compromising the casе. Plaintiff alleges that the insurance company violated the New Jersey Consumer Fraud Act, N.J.Stat.Ann. §§ 56:8-1, et seq., and engaged in unfair and deceptive insurance practices contrary to N.J.Stat.Ann. §§ 17:29B-1, et seq.
Cooper’s position is that because the doctors and hospital were additional insureds under the policy, their contributions amounting to $950,000 should be credited toward the one million dollar retention. According to this theory, Cooper would owe $50,000, thus satisfying the remainder of the retention and leaving ISLIC the obligation to reimburse Cooper for the final $900,000 paid towаrd the settlement amount of $1,900,000. In addition, Cooper demands that its attorney’s fees be paid by ISLIC.
Deciding in favor of ISLIC on summary judgment, the district court concluded that neither the hospital nor the doctors were covered under the vendor’s endorsement. That the hospital both furnished the drug and charged for it would not, according to the court, “constitute a sale of drugs in the course of the hospital’s business in the plain, ordinary and commonly understood meaning of the endorsement.” Applying the same standard of ordinary meaning, the court similarly concluded that the hospital had not distributed the drug. Likewise, since the physicians had not actually sold the product, the court declined to consider them sellers or distributors as that term is understood in general commercial usage.
The court also denied Cooper’s claim for the cost of its defense. Reasoning that ISLIC’s duty arose only after Cooper had exhausted its one million dollar retention, the court observed that this condition precedent had not occurred. Therefore, no payment of damages, “to which this insurance applies” as the policy read, had taken place. The court drew an analogy between Cooper and a “primary insurer”, which customarily pays the cost of defense.
ISLIC’s conduct in allegedly coercing Cooper into settling the personal injury case was found to raise factual issues precluding granting summary judgment.
On appeal, Cooper contends that the policy must be interpreted either in accordance with the reasonable expectation of the average insured or according to the purpose defined in the language. Viewed in that light, the argument continues, there was an actual sale of the drug by the hospital. In addition, both it and the physicians were *671 distributors of prescription drugs. With respect to the reimbursement of attorney’s fees, Cooper asserts that ISLIC was obligated to defend when the personal injury plaintiff submitted a demand that fell within the carrier’s excess limits.
ISLIC argues that since the physicians provide only a service, they are not conduits for the distribution of a commercial product. Moreover, the complaint in the personal injury сase charged both the hospital and physicians with malpractice, not with the vicarious liability of retailers of a defective product. With respect to the duty to defend, ISLIC observes that Cooper had retained its own attorneys who actively conducted its defense for two years before notifying the carrier of the claim. Finally, ISLIC says that as a self-insured, Cooper was obligated to defend itself, at least until it had paid its million dollar retention.
I
STANDARD OF REVIEW
In analyzing the issues presented, the district court reasoned that where contract terms are unambiguous and capable of resolution as a matter of law, summary judgment is appropriate. The court cited
Newark Publishers’ Ass’n v. Newark Typographical Union,
We agree that the issues to be resolved here are matters of law, but we arrive at that conclusion by a somewhat different route. Although courts sometimes use “construction” and “interpretatiоn” of a contract interchangeably, a difference exists between the two terms which may affect the allocation of functions between judge and jury, as well as the standard of review on appeal. In
Ram Constr. Co. Inc. v. American States Ins. Co.,
“When a court gives a сonstruction to the contract as that is affected by events subsequent to its making and not foreseen by the parties, it is departing very far from mere interpretation____” 3 A. Corbin On Contracts § 534 at 9 (1960). Professor Corbin explains that when a court is filling gaps in an agreement about matters that the parties had not contemplated “and as to which they had no intention to be expressed, the judicial process should not be called interpretation____ The most common sort of ‘gap’ that must be filled is found when, long after the parties have made their agreement an evеnt occurs that they did not foresee.” Id. at 11-12. When courts determine its legal effect, "the process may be called ‘construction’; it should not be called ‘interpretation’.” Id. at 12. See also Patterson, The Interpretation and Construction of Contracts, 64 Colum. L.Rev. 833, 835 (1964).
New Jersey appellate decisions also state that construction of a contract is a matter for the court, not for the jury.
See Ace Stone, Inc. v. Township of Wayne,
II
SUBSTANTIVE LAW
In diversity cases, however, state substantive law controls the construction of a contract. Generally, New Jersey follows the rule that a contract “be construed in the context of the circumstances under which it was entered into.”
Tessmar v. Grosner,
If the contract is an insurance policy, New Jersey holds that “courts are bound to protect the insured to the full extent that any fair interpretation will allow.”
Mazzilli v. Accident & Casualty Ins. Co. of Wintherthur,
A number of subsidiary rules of construction are also found in
Mazzilli.
“[W]here the policy provision undеr examination relates to the inclusion of persons other than the named insured within the protection afforded, a broad and liberal view is taken of the coverage extended.”
Id.
at 8,
Ill
THE VENDOR’S ENDORSEMENT
With these general statements as guideposts, we turn now to the specific questions presented, beginning with the vendor’s endorsement.
The pertinent language reads: “the ‘persons insurеd’ provision is amended to include any person or organization (herein referred to as ‘vendor’) as an insured but only with respect to the distribution or sale in the course of the vendor’s business of the name insured’s products____” This clause is followed by a number of exclusions not pertinent to the issue on review.
Because there are critical differences in the relevant functions of the physicians and the hospital, we will examine the policy provision as it applies to each in turn. Conceding, as did the district court, that the doctors could bе said to be in the “business” of providing health care and that the prescription of pharmaceuticals is part of that occupation, we must inquire whether their activities amounted to a sale or distribution.
The record demonstrates only that the physicians followed routine practice in prescribing a drug. They had not purchased it for resale, held it on consignment, or even had it in their possession before it was administered to the patient. Nor did the physicians bill the patient for the drug. Under any fair construction of the language, the doсtors did not sell the drug to their patient. They sold only their professional knowledge and skill.
See Magrine v. Krasnica,
Finding no appellate decisions to aid in determining whether the physicians were “distributors,” the district court turned to the dictionary and adopted its definition of distribute: “to sell, offer for sale, or deliver an item or line of merchandise to individual customers, especially in a specified region or area.” We accept that as an appropriate test, and find no error in the district court’s determination that the physicians did not distribute the drug. Consequently, we agrеe that the physicians do not qualify as vendors within the meaning of the endorsement, and are not covered by ISLIC’s policy.
*673
The hospital, however, did purchase the substance and kept it in its pharmacy before it was delivered to the patient. More significantly, the hospital billed the patient for the drug. This transaction was in reality no different than if the patient’s parents had taken the prescription to the neighborhood pharmacy, purchased the drug, and then given it to the patient.
See Jackson v. Muhlenberg Hospital,
IV
POLICY COVERAGE OF THE HOSPITAL
Although the hospital comes within the terms of the endorsement, that alone does not establish its right to coverage for damages attributable to the patient’s injury. The ISLIC policy focuses on liability attributable to a product defect and obligates the carrier to pay damages if the bodily injury “is included within the product’s hazard.” In a separate seсtion, product hazard is defined as “bodily injury ... arising out of the named insured’s products or reliance upon a representation or warranty made at any time with respect thereto.” The vendor’s endorsement specifically excludes coverage for “any express warranty unauthorized by the named insured.”
A reading of both the policy and the full text of the endorsement reveals a design to provide vendors with coverage for claims against them as links in the chain of distribution from manufacturer to consumer. The New Jersey Superior Court explained that the law of strict liability in tort “illustrates the underlying reasons for the existence of the vendor’s endorsement.”
American White Cross Laboratories, Inc. v. Continental Ins. Co.,
That rationale, however, also limits the vendor’s coverage, which is generally intended to protect those entities only secondarily liable for the manufacturer’s failure to provide a safe product.
White Cross
cautions that “[t]he vendor receives a more limited form of coverage which does not protect it against its own acts proximately related to the consumer’s injury.”
Id.
at 380,
Because the trial of the child’s personal injury action was settled without any findings on culpability, the record does not establish the basis on which the hospital would have been liable. If the grounds were purely malpractice as ISLIC contends, its policy would not indemnify the hospital. If, on the other hand, a products liability claim were the basis for liability, the hospital would come within the policy’s scope.
The district judge did note that both malpractice and products liability claims had been asserted against the hospital, but because of the ruling that it was not a vendor, he had no occasion to determine the basis for the hospital’s potential liability to the patient. At this stage, however, be *674 cause of our conclusion that the hospital is within the vendor’s endorsement, the liability issue between it and the patient must be explored and resolved.
In
American Home Assurance Co. v. Libbey-Owens-Ford Co.,
The case at hand may also be one where an allocation must be made. The question is a factual one which must be addressed before coverage can be determined. If the district court finds that the hospital’s liability rests on two bases — one which is within the policy and one with out — then an equitable apportionment between the two grounds must be made. This, then, is another issue which remains for the remand.
V
LIMITS ON COOPER’S POSSIBLE RECOVERY
The necessity for making this allocation rests on Cooper’s retention of one million dollars underlying ISLIC’s limits. The pertinent language on the amount of insurаnce reads: “$1,000,000 combined single limit BI PD each occurrence and aggregate excess of $1,000,000 combined single limit BI and PD each occurrence and aggregate self-insured retention____” The coverage definition does not separate damages for bodily injury and property damage (BI and PD) and limits ISLIC’s obligation to one million dollars. Similarly, Cooper’s retention is both single limit and “aggregate.” Experts for ISLIC and Cooper agree that the terms of the retention apply to the total of expenditures toward settlement made by all those insured under the policy.
By way of illustration only, if the hospital’s culpability were premised solely on its malpractice and thus not within the scope of the product’s hazard, then the hospital’s contribution would not be applied toward the retention. In that event, ISLIC would have no duty to indemnify Cooper for the latter’s payment of $950,000, an amount less than the retention.
On the other hand, if the hospital’s responsibility were based only on products liability and thus covered by the policy, then the hospital’s contribution of $300,000 would be credited toward the retention. When Cooper’s contribution of $950,000 is taken into account, the retention of one million dollars would be exceeded, and ISL-IC would be exposed to the $250,000 in excess of that figure.
One further step, however, must be taken in the event the retention was satisfied by the joint contributions of both the hospital and Cooper. It must not be forgotten that this suit is brought solely by Cooper, yet it seeks to take full advantage of the sum paid by the hospital which is not a party. The hospital’s payment does not constitute a loss by Cooper, which has asserted no speсial relationship, contractual or otherwise, entitling it to full reimbursement occasioned by the $300,000 contribu *675 tion. In the circumstances, it would be inequitable to allow full recovery.
We conclude that if the joint expenditures of Cooper and the hospital exceed the retention amount, then ISLIC would be required to indemnify Cooper only to the extent of its pro rata share. To be specific, if it is determined that the settlement covered by the terms of the policy exceeds the retention by $250,000, then Cooper would be entitled to a proportionate share of the $250,000 based upon the respective contributions of $950,000 and $300,000. Mathematical computation establishes that figure to be $190,000.
We emphasize that these computations are illustrative only, and are not to be read as anything other than that, because the factual issues on liability to be developed by the district court may change the calculations, or make them unnecessary. We intimate no position on what the ultimate outcome of the district court’s factual determinations should be.
VI
COST OF DEFENSE
Cooper also submitted a claim to ISLIC for reimbursement of defense costs. As noted earlier, the policy stated that if the “bodily injury ... is included within the products hazard, the [carrier] shall have the right and duty to defend any suit against the Insured.”
ISLIC argues that because its policy is excess to the retention, Cooper has the obligation to defend as do primary insurers as a matter of insurance industry custom. This contention may be dismissed rather quickly. Cooper is neither a primary insurer nor an insurer at all. A duty to defend is a matter of contract, and the reason why primary insurers рrovide a defense is that their policies require that they do so. An industry custom allocating responsibility when two carriers both may have a contractual duty is not applicable when one of the parties bears no obligation.
See American Nurses Ass’n v. Passaic Gen. Hosp.,
The duty to defend is confined to the risk covered by the policy, and if the allegations of the claim come within those perimeters, the carrier must meet its obligation even if the averments in the complaint are groundless or false.
Ohio Casualty Ins. Co. v. Flanagin,
If the circumstances are such that the scope of coverage and the correlative duty to defend may not be resolved until factual matters surrounding the claim have beеn determined at trial, the obligation to furnish a defense is transformed to one of reimbursement to the insured. If the circumstances are such that trial of the underlying claim would present a conflict between the interests of the insurer and insured with respect to the coverage issue, the carrier defends at its peril unless the insured has consented to representation by the carrier.
Burd v. Sussex Mutual Ins. Co.,
Cooper contends that ISLIC’s obligation to defend arose when plaintiff submitted its first demand in the amount of $3,500,-000, a claim within ISLIC’s policy limits. Cooper does not contend that thе “right and duty to defend” language imposes an unlimited obligation on ISLIC, but restricts the argument here to claims “seeking damages in excess of the retention.” Brief for Appellant at 40.
See Rooney v. Township of West Orange,
200 N.J.Super 201, 206,
*676
It is clear enough that if the judgment sought against the insured is one that the carrier would be required to pay, then the duty to defend exists.
Hartford Accident & Indemnity Co. v. Aetna Life & Casualty Ins. Co.,
Although that result would end the matter were this the usual struggle between a primary insurer and an insured without a substantial retention, we may not overlook the realities of the relationship between the present parties. As Cooper’s charges of unfair practices illustrate, there was not complete harmony between the aims of Cooper and ISLIC in conducting the personal injury litigation.
The carrier was obviously interested in having the child’s case settled by Cooper somewhere below the one million dollar retention mark. On the other hand, Cooper wished to pay as little of that first one million dollars as it could negotiаte, or if no savings could be realized on the retention, perhaps take a chance on a favorable jury verdict. To some extent each of the parties would be gambling with the other’s money.
See Puritan Ins. Co. v. Canadian Universal Ins. Co.,
Although Cooper has paid its counsel for defending the personal injury suit, it would have paid fees to safeguard its interest in any event. Consequently, the district court shоuld allocate the fees expended to reflect the respective interests of Cooper and ISLIC. Unlike the apportionment of liability on the part of the hospital discussed earlier, we propose no ratio based on the ultimate indemnity payments that may be decided by the district court. Rather, we suggest that the district court disallow Cooper what it would have expended to protect its own interest had ISL-IC accepted the defense after the March 1982 demand. We will remand for that purpose. Again, for the sake оf clarity, we emphasize that even if the district judge determines that ISLIC is not required to pay anything toward the personal injury settlement, it still must reimburse Cooper for part of the cost of defense.
We are not persuaded that Cooper waived its claim for defense by waiting until the trial of the personal injury suit had begun. At the time the original demand was made, ISLIC became aware that its coverage was on the line, yet it took no steps to assume the defense. In fact, the carrier appeared content to allow Cooper’s attоrneys to conduct the litigation. That decision appears sound under all the circumstances, where bringing in additional trial counsel might have been adverse to the common interests of both Cooper and ISLIC. The issue really is one of reimbursement. We see no evidence that Cooper waived its rights in that respect.
Accordingly, the judgment of the district court will be vacated and the case remanded for further proceedings consistent with this opinion.
Notes
. The case before us is distinguishable from
Pacific Indemnity Co. v. Linn, 766
F.2d 754 (3d Cir.1985), decided under Pennsylvania law. In that case, the district court had directed various insurancе companies to defend cases brought against their insured even though that litigation included some claims which were not within the policies’ coverage. When cases were later settled by the insurance carriers, the court refused to attempt allocation of indemnity and simply made it correspond to the duty to defend. In that instance, this court noted that by settling without an agreement with the insured, the carrier conceivably could foreclose any right of indemnification by the insured. Here, by contrast, the insured settled the case so it is not exposed to the risk that influenced the
Linn
decision.
Linn
is to be contrasted with
American Home Assurance Co. v. Libbey-Owens-Ford Co.
and
Employers Mutual Liability Ins. Co. of Wisconsin v. Hendrix,
which we believe would be followed in the New Jersey courts.
See also Burd
v.
Sussex Mutual Ins. Co., 56
N.J. 383,
