
    HEALTH COST CONTROLS, Plaintiff-Appellant, v. Richard L. SKINNER, Rosalie Skinner, individually and as administrators of the Estate of Sharon Skinner, a minor, Rick A. Mason, et al., Defendants-Appellees.
    No. 94-1433.
    United States Court of Appeals, Seventh Circuit.
    Argued Sept. 13, 1994.
    Decided Jan. 5, 1995.
    David A. Belofsky (argued), James J. Mer-riman, Belofsky & Associates, Chicago, IL, for plaintiff-appellant.
    Thomas A. Thanas (argued), Richard B. Orloff, Scott R. Reich, Mason, Orloff, Reich, Troy & Thanas, Joliet, IL, for Rick A. Mason, Richard L. Skinner, Rosalie Skinner.
    Barbara Naretto Petrungaro (argued), Swanson, Martin & Bell, Chicago, IL, David J. Cahill, Swanson, Martin & Bell, Wheaton, IL, for General Cas. Ins. Defendant-Appel-lee.
    
      Before LAY, BAUER, and WOOD, Jr., Circuit Judges.
    
      
       The Honorable Donald P. Lay, Circuit Judge for the United States Court of Appeals for the Eighth Circuit, sitting by designation.
    
   LAY, Circuit Judge.

Health Cost Controls (“HCC”) commenced this action under section 502(a)(3) of the Employee Retirement Income Security Act of 1974 (“ERISA”). It seeks to enforce the terms of an employee benefit plan. The district court dismissed the complaint for lack of subject matter jurisdiction. We reverse and remand for further proceedings.

BACKGROUND

Richard Skinner and his daughter, Sharon Skinner, are participants in an employee welfare benefit plan (“the Plan”) established by the Mobil Oil Corporation. H.M.O. Illinois, Inc. (“HMO Illinois”) provides managed care services for some Plan participants, including the Skinners, and HCC has been authorized by HMO Illinois to prosecute all of its rights to subrogation and reimbursement under the Plan. The Plan contains a reimbursement provision requiring a participant injured by a third party to reimburse the Plan for any benefits the Plan provides for the injury if the participant ultimately recovers from the third party. The Plan may recover the cost of the benefits from the amount of any settlement or judgment the participant obtained against a third party.

Sharon Skinner was injured in an automobile accident in October 1991. HCC alleges that benefits worth $67,815.58 were paid to Sharon for treatment of injuries sustained in the accident. The Skinners sought recovery for Sharon’s injuries from a third-party tortfeasor. In 1992, HCC sent a notice of lien to the third-party tortfeasor’s third-party insurance company, General Casualty Insurance Company (“General Casualty”), and the Skinners’ attorney informing them of the Plan’s right to reimbursement. In January 1994, the Skinners settled with the party responsible for Sharon’s injuries for $118,-608.87. The Skinners failed to reimburse the Plan as required by its terms, and HCC filed a seven-count complaint against the Skinners as administrators of the estate of Sharon Skinner, the Skinners individually, Rick A. Mason, their attorney, and General Casualty. The district court dismissed the action sua sponte for lack of jurisdiction 845 F.Supp. 567. HCC appeals.

ANALYSIS

The narrow question presented for our review is whether HCC properly invoked the subject matter jurisdiction of the district court. This Court reviews de novo a dismissal for lack of subject matter jurisdiction. Joyce v. Joyce, 975 F.2d 379, 382 (7th Cir.1992).

Section 502(a)(3) of ERISA permits fiduciaries to bring suit “(A) to enjoin any act or practice which violates any provision of this subchapter or the terms of the plan, or (B) to obtain other appropriate equitable relief (i) to redress such violations or (ii) to enforce any provisions of this subchapter or the terms of the plan.” 29 U.S.C. § 1132(a)(3) (1988). Section 502(e) grants federal courts exclusive jurisdiction to entertain actions brought under section 502. 29 U.S.C. § 1132(e) (Supp. 1993). HCC’s complaint states that it is a fiduciary of the Plan within the meaning of section 502(a)(3) and that it seeks “to obtain appropriate equitable and declaratory relief’ to enforce provisions of the Plan under that section. At the end of each count of its complaint, however, 11CC requests "compensatory damages" in the amount of the benefits it provided to Sharon Skinner for her injuries. The district court found that it lacked subject matter jurisdiction over this action because the relief HOC sought was not equitable in nature, but rather was a claim for "money damages," which would be impermissible under section 502(a)(3). We reverse and remand.

The district court found that HOC failed to properly allege equitable relief permitted under the statute. However, we find the district court's reasoning does not negate the existence of federal subject matter jurisdiction, but rather indicates that HOC may have failed to state a proper claim for relief under section 502(a)(3).

When both the subject matter jurisdiction of the federal court and the substantive claim for relief are based on a federal statute, dismissal for lack of subject matter jurisdiction is proper only when the allegations of the complaint are frivolous. Malak v. Associated Physicians, Inc., 784 F.2d 277, 279-80 (7th Cir.1986); Timberlane Lumber Co. v. Bank of America, 549 F.2d 597, 602 (9th Cir.1976); see also Bell v. Hood, 327 U.S. 678, 682, 66 S.Ct. 773, 776, 90 L.Ed. 939 (1945) (finding substantial constitutional claim adequate to invoke federal subject matter jurisdiction). As Moore's Federal Practice explains:

[hf a federal statute upon which a claim is premised is interpreted to be inapplicable, it could be argued that the plaintiff has failed to present a federal question and thus subject matter jurisdiction is absent. However, the courts have uniformly held that in such instances the preferable practice is to assume that jurisdiction exists and proceed to determine the merits of the claim pursuant to {Rule 12(b)(6) or Rule 56].

2A James W. Moore et al., Moore's Federal Practice ¶ 12.07[2.-1] (2d ed. 1994). Thus, if a plaintiff fails to properly allege a claim for relief brought under a federal statute, the case should be dismissed under Federal Rule of Civil Procedure 12(b)(6), rather than Rule 12(b)(1). Romero v. International Terminal Operating Co., 358 U.S. 354, 359, 79 S.Ct. 468, 473, 3 L.Ed.2d 368 (1959) (finding the mere assertion of a substantial claim under a federal statute sufficient to permit a district court to assume jurisdiction and determine whether the statute does provide the claimed rights); Gonzalez v. Southern Pac. Transp. Co., 773 F.2d 637, 645 (5th Cir.1985) (same).

This Court ordinarily may modify a dismissal for lack of jurisdiction and convert it to a dismissal on the merits if warranted. See, e.g., Shockley v. Jones, 823 F.2d 1068, 1073 (7th Cir.1987); White v. Elrod, 816 F.2d 1172, 1176 (7th Cir.), cert. denied, 484 U.S. 924, 108 S.Ct. 286, 98 L.Ed.2d 246 (1987). Under the circumstances in this case, however, modification would be inappropriate. The district court dismissed the action sua sponte, and HCC had no opportunity to respond or to amend its complaint. The Supreme Court has stated the following with respect to dismissal under Rule 12(b)(6):

Under Rule 12(b)(6), a plaintiff with an arguable claim is ordinarily accorded notice of a pending motion to dismiss for failure to state a claim and an opportunity to amend the complaint before the motion is ruled upon. These procedures alert him to the legal theory -underlying the defendant’s challenge, and enable him meaningfully to respond by opposing the motion to dismiss on legal grounds or by clarifying his factual allegations so as to conform with the requirements of a valid legal cause of action. This adversarial process also crystallizes the pertinent issues and facilitates appellate review of a trial court dismissal by creating a more complete record of the case.

Neitzke v. Williams, 490 U.S. 319, 329-30, 109 S.Ct. 1827, 1834, 104 L.Ed.2d 338 (1989); see also Shockley, 823 F.2d at 1073 (stressing importance of notice and opportunity to be heard before 12(b)(6) dismissal). We believe basic principles of fairness and the Federal Rules of Civil Procedure require that HCC, if faced with the possible dismissal of its complaint, have the opportunity to amend its complaint to request equitable relief under both federal common law and § 502(a)(3). Whether the facts and any claim that might be pled will state a claim for relief is then for the district court to pass upon under Federal Rule of Civil Procedure 12(b)(6).

Thus, reserving to the district court a determination as to whether HCC has stated a claim upon which relief may be granted, we reverse the district court’s dismissal for want of subject matter jurisdiction and remand for further proceedings. 
      
      .Appellees claim they are not required to reimburse HCC under state law and that this action is barred by the doctrine of res judicata because a state court has already denied HCC's liens. That issue can be raised in the district court on remand; it is not properly before this Court because the district court dismissed the action solely on the ground that subject matter jurisdiction was lacking.
     
      
      . Included in the seven counts of the complaint are state claims for breach of lien and tortious interference with contract against General Casualty and the Skinners' attorney. Those claims were joined under principles of supplemental jurisdiction.
     
      
      . The district court expressed doubt that HCC was in fact a fiduciary as defined in ERISA. A party is an ERISA fiduciary to the extent it "exercises any discretionary authority or discretionary control respecting management” of a plan. 29 U.S.C. § 1002(21)(A)(i) (1988). The term includes any person designated under another ERISA provision which specifies that a named fiduciary may appoint others to carry out certain fiduciary responsibilities. 29 U.S.C. § 1105(c)(l)(B) (1988). HOC therefore may qualify as an ERISA fiduciary, although we leave the ultimate resolution of that issue to the district court. In any event, like the district court, we will assume HCC is a fiduciary in rendering this decision.
     
      
      . HCC asserts in the alternative that its claim arises under the federal common law of ERISA. It asks this Court to imply a federal common-law remedy of unjust enrichment under ERISA. See Provident Life & Accident Ins. Co. v. Waller, 906 F.2d 985, 993 (4th Cir.) (implying a federal common-law remedy for unjust enrichment), cert. denied, 498 U.S. 982, 111 S.Ct. 512, 112 L.Ed.2d 524 (1990). Such a federal common-law claim has been previously recognized by Judge Suzanne B. Conlon, who also sits in the Northern District of Illinois, Eastern Division. See Pople v. Cox, No. 93 C 6274, 1994 WL 63006, at * 5 (N.D.Ill. November 9, 1993). In a later district court case, Judge Shadur, relying on his reasoning in this case, stated:
      With all respect, that conclusion by this Court's colleague Honorable Suzanne Conlon is directly at odds with the teaching of Massachusetts Mutual [Life Insurance Co. v. Russell, 473 U.S. 134, 105 S.Ct. 3085, 87 L.Ed.2d 96 (1985)1 that rejects such implied claims where Congress has been so careful in devising "ERISA'S interlocking, interrelated, and interdependent remedial scheme, which is in turn part of a `comprehensive and reticulated statute'" (473 U.S. at 134 [105 S.Ct. at 3085]).
      Hedberg v. Zaldivar, No. 94 C 1117, 1994 WL 71424, at * 2 (N.D.Ill. Mar. 2, 1994). We need not determine at this juncture which view is correct because the court below did not address whether HCC had stated a proper claim for relief under federal common law.
     
      
      . Restitution may be in the form of monetary relief. Thus, although HCC clearly cannot recover compensatory damages under section 502(a)(3), if it successfully makes out a claim for restitution, admittedly an equitable action, it may be entitled to monetary relief.
     
      
      . As HCC urges in its appellant’s brief:
      Even if the complaint mischaracterized the relief to which plaintiff was entitled, it was at best premature to sua sponte dismiss the complaint two days after it was filed because plaintiff never had a meaningful opportunity to be heard or to amend its complaint. The district court could not at the time have properly determined with any certainty that plaintiff could prove no set of facts sufficient to state a federal claim.
     
      
      . The Supreme Court recently found that equitable relief under section 502(a)(3) includes "categories of relief that were typically available in equity (such as injunction, mandamus, and restitution, but not compensatory damages)." Mertens v. Hewitt Assoc., - U.S. -, -, 113 S.Ct. 2063, 2069, 124 L.Ed.2d 161 (1993) (emphasis in original). Restitution and constructive trust are remedies available only when one party has been unjustly enriched at another's expense. Dan B. Dobbs, The Law of Remedies § 4.1 (1973); Restatement of Restitution § 1 (1937). To the extent HCC can demonstrate the parties it has sued have been unjustly enriched at its expense, it may be able to establish it is entitled to restitution or a constructive trust, permissible forms of relief under Mertens.
      
     