
547 N.W.2d 548 (1996)
Lance E. ISAAC, Plaintiff and Appellant,
v.
STATE FARM MUTUAL AUTOMOBILE INSURANCE COMPANY, Defendant and Appellee.
Civil No. 950398.
Supreme Court of North Dakota.
May 14, 1996.
Ronald F. Fischer of Pearson, Christensen, Larivee, Clapp, Fiedler & Fischer, Grand Forks, for plaintiff and appellant.
*549 Scott J. Landa of Vaaler, Warcup, Woutat, Zimney & Foster, Grand Forks, for defendant and appellee.
SANDSTROM, Justice.
In this case we are asked to decide whether a seriously injured insured can seek declaratory judgment as to the right of his no-fault insurer to seek equitably allocated reimbursement from the other driver's insurer. And we are asked to decide whether the no-fault insurer can be sued for refusing to waive its statutory right to equitable allocation. Answering no to both, we affirm the summary judgment of dismissal and denial of the motion to amend the complaint.

I
On August 28, 1990, Isaac was involved in an automobile accident. State Farm Mutual Automobile Insurance Company insured Isaac. American West Insurance Company insured the driver of the other car. State Farm paid Isaac over $18,000 in no-fault benefits for the medical treatment of his injuries.
Isaac later informed State Farm he was attempting to negotiate a settlement of his personal injury claim against the driver of the other car. Isaac requested State Farm waive its right to recover from American West the no-fault benefits already paid to Isaac. State Farm refused. Under N.D.C.C. § 26.1-41-17, State Farm is seeking reimbursement from American West for the amounts State Farm had paid to Isaac in no-fault benefits.
Isaac reached a settlement with American West for $67,900. The agreement provided, in part:
"5. It is further understood and agreed that in the event any claim is made against [American West], including, without limitation, any claim for subrogation, indemnity or contribution, or any claim by any person or entity not a party to this release for damages or compensation by reason of the allegations contained in the complaint, including any liens against the proceeds hereunder, and including subrogation claims by State Farm Mutual Insurance Company, or any medical care provider or insurer, [Isaac] will indemnify and hold harmless [American West] from all such claims and or judgments thereupon."
About $18,000 of the total settlement between Isaac and American West was placed in an escrow account for final distribution after settlement of State Farm's claim against American West.
Isaac brought this declaratory action against State Farm to determine whether State Farm is entitled to reimbursement from American West for the amount it has paid to Isaac. The action also sought a declaration that Isaac was entitled to the $18,000 held in escrow.
In its memorandum decision, the district court stated:
"Section 26.1-41-17, NDCC, provides for the equitable allocation of no-fault benefits between insurers, by agreement or by binding arbitration. State Farm paid Isaac no-fault benefits; at a minimum, State Farm has a statutory right to arbitration to determine if it is entitled to remuneration from American West. NDCC § 26.1-41-17. That Isaac has entered into a contract to subrogate or indemnify American West does not affect the statutory rights of State Farm; State Farm was not a party to that contract.
"State Farm owes no statutory nor contractual responsibility toward Isaac to abstain from recovering no-fault benefits it has paid. Rather, State Farm is entitled to such rights and remedies as are available it under chapter 26.1-41, NDCC."
Following this decision, Isaac filed a motion for reconsideration with the court on August 22, 1995. On September 1, 1995, Isaac also filed a motion to amend his complaint to include claims for "damages based upon State Farm's alleged breach of contract and breach of its duty of good faith and fair dealing, i.e., bad faith in failing to waive its subrogation claim," in addition to its claim for declaratory relief.
In its order denying both motions, the district court made the following findings:

*550 "1. That State Farm Insurance has a statutory right to recover no-fault benefits paid to Isaac under § 26.1-41-17 NDCC.
"2. That if State Farm and American West cannot agree on the amount owed to State Farm for a subrogation claim, the parties must submit to binding arbitration in accordance with § 26.1-41-17 NDCC.
"3. That the agreement made between Isaac and American West, to place monies of an equivalent amount to the no-fault benefits paid by State Farm to Isaac into an escrow account, does not prejudiced [sic] State Farm's right to a subrogation claim.
"4. That State Farm has not asserted a claim to the escrow account for recovery of no-fault benefits paid to Isaac.
"5. That the Amended Complaint seeks damages for breach of contract and for breach of the obligator to act in good faith. The Amended Complaint fails to state a claim upon which relief can be granted as State Farm has no contractual or statutory obligation toward Isaac not to pursue its subrogation claim against American West."
On October 13, 1995, the district court issued an order granting State Farm's motion for judgment on the pleadings, denying Isaac's motion for reconsideration and motion to amend complaint, and dismissing Isaac's complaint with prejudice.
Isaac appeals, contending: (1) the district court erred in holding his original complaint for declaratory relief did not state a claim upon which relief can be granted; and (2) the district court erred in denying his motion to amend his complaint concerning State Farm's alleged bad faith refusal to waive its subrogation claim.
The district court had jurisdiction under N.D.C.C. § 27-05-06. The appeal is timely under N.D.R.App.P. 4(a). This Court has jurisdiction under N.D. Const. Art. VI, § 6, and N.D.C.C. § 28-27-01.

II
Isaac contends the district court erred in holding his original complaint for declaratory relief did not state a claim upon which relief can be granted.
"A trial court may, on its own initiative, and in the cautious exercise of its discretion, dismiss a complaint for failure to state a valid claim under Rule 12(b), N.D.R.Civ.P." Ennis v. Dasovick, 506 N.W.2d 386, 389 (N.D.1993). "A trial court should dismiss under Rule 12(b) only when certain it is impossible for the plaintiff to prove a claim for which relief can be granted." Ennis. "In an appeal from a Rule 12(b) dismissal, we construe the complaint in the light most favorable to the plaintiff, taking as true the allegations in the complaint." Ennis.
The benefits State Farm paid to Isaac were basic no-fault benefits, as contemplated by our no-fault law contained in N.D.C.C. ch. 26.1-41. N.D.C.C. § 26.1-41-16 gives no-fault insurers subrogation rights against any driver whose automobile is not insured as required by law (who is not a "secured person"). Burgener v. Bushaw, 545 N.W.2d 163, 166 (N.D.1996). Because the driver of the other car is a "secured person," State Farm has no rights of subrogation against that driver. Burgener.
State Farm, however, asserts its claim against American West under N.D.C.C. § 26.1-41-17. That section provides a no-fault insurer may seek reimbursement from a secured person's insurer under an "equitable allocation" theory if the "injured person was injured seriously." N.D.C.C. § 26.1-41-17; Burgener. We recently noted "equitable allocation is a purely statutory remedy between insurers, a remedy separate and distinct from subrogation." Burgener at 167. We added, N.D.C.C. § 26.1-41-17 "does not provide a subrogation interest against the tortfeasor, but creates a right of equitable allocation directly against the tortfeasor's liability insurer through agreement or inter-company arbitration." Burgener at 166.
In reviewing a statute, "our primary objective is to ascertain the intent of the legislature by looking at the language of the statute itself and giving it its plain, ordinary and commonly understood meaning." Van Klootwyk v. Arman, 477 N.W.2d 590, 591 (N.D.1991).
*551 N.D.C.C. § 26.1-41-17 clearly and unambiguously gives State Farm the right to equitable allocation. Isaac does not cite any case law or legislative history indicating the North Dakota legislature intended to abrogate an insurer's right to reimbursement if the insured had not been "made whole" by the proceeds of the settlement. As the trial court noted, Isaac's contractual duties to American West flowing from the settlement agreement do not affect the reimbursement rights of State Farm. See Burgener ("The import of Imperial [Casualty & Indemnity Co. v. General Casualty Co., 458 N.W.2d 335 (N.D.1990)] is clear: a tortfeasor's insurer who settles with an injured party, with knowledge of potential reimbursement claims of a no-fault insurer, does so at its own risk"). The district court properly dismissed the action.

III
Isaac next contends the district court erred in denying his motion to amend his complaint with his claim that State Farm's refusal to waive its right to reimbursement subjects it to a claim of bad faith.
Under N.D.R.Civ.P. 15(a), a party may amend a pleading only with permission of the court, but permission must be "freely given when justice so requires." This Court does not reverse an order denying a motion to amend, absent an abuse of discretion. Hellman v. Thiele, 413 N.W.2d 321, 323 (N.D.1987). If the proposed amended complaint fails to state a claim upon which relief can be granted, the motion to amend need not be granted. Galloway v. Forum Pub. Co., 138 N.W.2d 798, 802 (N.D.1965).
A bad faith claim against an insurance company requires the breach of a duty. See Bender v. Time Ins. Co., 286 N.W.2d 489, 492 (N.D.1979).
An insurance company's seeking of recoverable, equitably allocated reimbursement to which it is statutorily entitled is not bad faith. See Coyne v. Allstate Ins. Co., 771 F.Supp. 673, 678 (E.D.Pa.1991); U.S. Fire Ins. Co. v. Royal Ins. Co., 759 F.2d 306, 311 (3d Cir.1985).
The trial court did not abuse its discretion in denying Isaac's motion to amend.

IV
The judgment of the district court is affirmed.
VANDE WALLE, C.J., NEUMANN and MARING, JJ., and RALPH J. ERICKSTAD, Surrogate Judge, concur.
RALPH J. ERICKSTAD, Surrogate Judge, sitting in place of MESCHKE, J., disqualified.
