
564 S.E.2d 920 (2002)
Kerry P. CLANCY, Plaintiff,
v.
ONSLOW COUNTY, Onslow County Department of Social Services, and Onslow County Behavioral Healthcare Services, Defendants
No. COA01-977.
Court of Appeals of North Carolina.
July 2, 2002.
*921 John W. Ceruzzi and Andrew Kent Wigmore, Jacksonville, for plaintiff-appellee.
Cranfill, Sumner & Hartzog, L.L.P., by J. Gregory W. Brown and M. Regan Summerlin, Raleigh, for defendant-appellant Onslow County Behavioral Health Services.
Womble, Carlyle, Sandridge & Rice, P.L.L.C, by Mark A. Davis, Raleigh, for defendant-appellants Onslow County and Onslow County Department of Social Services.
CAMPBELL, J.
Kerry P. Clancy ("plaintiff") contracted with Onslow County Behavioral Healthcare Services ("BHS"), the mental health area authority for Onslow County, for plaintiff to provide treatment and care to disabled clients in his home. On or about 26 April 2000, Onslow County Department of Social Services ("DSS") received a complaint that one of plaintiff's clients, Lewis Simmons ("Simmons"), had an injury on the left side of *922 his face. When DSS asked how he had been injured, Simmons indicated that plaintiff had struck him. DSS immediately demanded that Simmons be removed from plaintiff's care and an investigation be initiated to determine if there was a case against plaintiff for abuse or neglect. DSS also recommended that BHS remove the one client remaining in plaintiff's home to another facility.
DSS' investigation substantiated that a problem existed with respect to plaintiff's care of Simmons. Based on this investigation, BHS revoked plaintiff's provider status and refused to place any more clients in his home. However, instead of appealing to BHS for reversal of its decision or initiating an administrative proceeding under North Carolina's Administrative Procedure Act, plaintiff filed a negligence action in Onslow County Superior Court on 18 July 2000 bearing case number 00 CVS 2295 (hereinafter, "Clancy I"). In his complaint, plaintiff named Onslow County ("OC") and DSS as defendants. On 11 August 2000, both defendants filed a motion to dismiss pursuant to Rule 12(b)(6) of the North Carolina Rules of Civil Procedure.
A hearing on the motion to dismiss was held on 21 August 2000 before Judge Steve A. Balog ("Judge Balog"), during which defendants' counsel argued that defendants owed no duty to individuals such as plaintiff who operate a health care facility for monetary gain. Counsel also argued that plaintiff's "remedy" was actually with BHS and not with either of the defendants. At the conclusion of the hearing, Judge Balog granted defendants' motion and signed an order previously prepared by defendants' counsel, but struck through the "with prejudice" language present in the order at the request of plaintiff's counsel. However, despite striking through this language, Judge Balog declined to rule specifically on whether plaintiff's action was dismissed with or without prejudice electing, instead, to let the parties "fight about that at a later date."
On 8 November 2000, plaintiff filed the complaint in the instant action naming OC, DSS, and BHS as defendants (hereinafter, "Clancy II"). This complaint was identical to plaintiff's previous negligence action in Clancy I, with the addition of BHS as a named defendant. The complaint in Clancy II also included an additional claim for slander. On or about 24 April 2001, defendants filed motions for judgment on the pleadings pursuant to Rule 12(c) of the North Carolina Rules of Civil Procedure with OC and DSS filing a joint motion and BHS filing a separate motion. On 7 May 2001, another hearing was held in the Onslow County Superior Court, this time before Judge James E. Ragan, III. On 22 May 2001, the court entered an order denying both motions for judgment on the pleadings. All three defendants appeal.
By their appeal, defendants raise issues involving res judicata and governmental immunity. A motion for judgment on the pleadings grounded on governmental immunity or based on res judicata affects a substantial right and is immediately appealable. See Mabrey v. Smith, 144 N.C.App. 119, 121, 548 S.E.2d 183, 185, disc. review denied, 354 N.C. 219, 554 S.E.2d 340 (2001); Wilson v. Watson, 136 N.C.App. 500, 501, 524 S.E.2d 812, 813 (2000). Therefore, this Court may properly consider the two issues raised by defendants in this case. For the following reasons, we reverse the trial court's denial of defendants' motions.

I.
OC and DSS raise the first issue presented to this Court, which is whether the trial court erred in denying their motion for judgment on the pleadings based on the doctrine of res judicata. We find the court's denial was in error.
The doctrine of res judicata was developed by the courts to protect "litigants from the burden of relitigating previously decided matters and promoting judicial economy by preventing needless litigation." Bockweg v. Anderson, 333 N.C. 486, 491, 428 S.E.2d 157, 161 (1993). Under this doctrine, "a final judgment on the merits in a prior action will prevent a second suit based on the same cause of action between the same parties or those in privity with them." Thomas M. McInnis & Assoc., Inc. v. Hall, 318 N.C. *923 421, 428, 349 S.E.2d 552, 556 (1986). The doctrine of res judicata also applies to those "issues which could have been raised in the prior action but were not. Thus, the doctrine is intended to force parties to join all matters which might or should have been pleaded in one action." Chrisalis Properties, Inc. v. Separate Quarters, Inc., 101 N.C.App. 81, 84, 398 S.E.2d 628, 631 (1990) (citations omitted).
Here, after having his claim for negligence against OC and DSS dismissed in Clancy I under Rule 12(b)(6), plaintiff brought an identical negligence claim, as well as a slander claim against the same two defendants in the present case. OC and DSS subsequently filed a motion for judgment on the pleadings arguing that plaintiff's suit against them was barred by the doctrine of res judicata. Plaintiff would have us believe that since the trial judge struck out the "with prejudice" language in the Clancy I order, we should assume defendants' motion was granted "without prejudice." However, it is well settled in this State that "[a] dismissal under Rule 12(b)(6) operates as an adjudication on the merits unless the court specifies that the dismissal is without prejudice." Hoots v. Pryor, 106 N.C.App. 397, 404, 417 S.E.2d 269, 274 (1992). See also N.C. Gen.Stat. § 1A-1, Rule 41(b) (2001). Since the court's order dismissing plaintiff's negligence claim in Clancy I did not specifically indicate that the dismissal was "without prejudice," we are compelled to conclude that the court's dismissal was "with prejudice." Thus, the trial court in Clancy II erred in denying defendants' motion for judgment on the pleadings because the court's dismissal of plaintiff's claim in Clancy I operated as an adjudication upon the merits of plaintiff's negligence claim in the instant action against these same defendants. Additionally, since plaintiff's slander claim was based on the same set of facts giving rise to the negligence claim in Clancy I and could have been raised in that action, it is barred by res judicata as well.

II.
The second issue presented to this Court is raised by BHS and requires us to determine whether the trial court erred in denying BHS' motion for judgment on the pleadings based on governmental immunity. Specifically, BHS argues that since OC and BHS are governmental units whose actions are covered under separate statutory provisions, the allegation in plaintiff's complaint that OC had waived its governmental immunity was not a sufficient allegation that BHS had also waived its governmental immunity. We agree.
"As a general rule, the doctrine of governmental, or sovereign, immunity bars actions against, inter alia, the state, its counties, and its public officials sued in their official capacity." Messick v. Catawba County, 110 N.C.App. 707, 714, 431 S.E.2d 489, 493 (1993) (citations omitted). Nevertheless, governmental immunity may be waived by the purchase of liability insurance, but only to the extent the governmental unit is "indemnified by the insurance contract from liability for the acts alleged. If a plaintiff does not allege a waiver of immunity by the purchase of insurance, the plaintiff has failed to state a claim against the governmental unit[.]" Mullins v. Friend, 116 N.C.App. 676, 681, 449 S.E.2d 227, 230 (1994) (citations omitted).
Pursuant to our statutes, a county in North Carolina (such as OC) may waive its governmental immunity by:
[Contracting] to insure itself and any of its officers, agents, or employees against liability for wrongful death or negligent or intentional damage to person or property or against absolute liability for damage to person or property caused by an act or omission of the county or any of its agents, or employees when acting within the scope of their authority and the course of their employment....
N.C. Gen.Stat. § 153A-435(a) (2001). In the case sub judice, plaintiff's complaint stated:
2. That the defendant, [OC], is a municipal corporation chartered under the laws and constitution of the State of North Carolina. [OC] is responsible for the policies and practices carried out by their agents, servants and employees. Said defendant... maintains and administers a department of mental health services known as [BHS].
3. That defendant, [OC], has waived its immunity from suit by the purchase of liability insurance.
*924 These allegations sufficiently pled a claim against OC by alleging that OC had waived its governmental immunity. However, BHS contends that since it is a mental health area authority (an assertion made by BHS that plaintiff never disputed in his brief to this Court), plaintiff was also required to allege BHS' waiver of governmental immunity because an area authority is covered under statutory provisions separate from those applicable to a county.
Chapter 122C of the General Statutes of North Carolina (The Mental Health, Developmental Disabilities, and Substance Abuse Act of 1985) contains provisions pertinent to mental health and substance abuse area authorities. It provides:
Within the public system of mental health, developmental disabilities, and substance abuse services, there are both area and State facilities. An area authority is the locus of coordination among public services for clients of its catchment area. To assure the most appropriate and efficient care of clients within the publicly supported service system, area authorities are encouraged to develop and secure approval for a single portal of entry and exit policy for their catchment areas for mental health and substance abuse authorities....
§ 122C-101 (Effective until July 1, 2002). Chapter 122C further defines these types of area authorities as "local political subdivision[s] of the State except that a single county area authority is considered a department of the county in which it is located for purposes of [local government finance]." § 122C-116(a).
Here, this Court agrees with BHS' assertion that it is a mental health area authority. As such, pursuant to Chapter 122C, BHS is a department of OC only for the purposes of local government finance. See id. Additionally, the parties do not dispute that the actions taken by BHS were governmental in nature, thus entitling it to governmental immunity. Chapter 122C provides a statutory provision that allows an area authority (like BHS) to:
[W]aive its governmental immunity from liability for damage by reason of death or injury to person or property caused by the negligence or tort of any agent, employee, or board member of the area authority when acting within the scope of his authority or within the course of his duties or employment.
§ 122C-152(a). "Under the statute, it is the Area Authority, not the County, that is indemnified by a decision to purchase insurance." Cross v. Residential Support Services, 123 N.C.App. 616, 619, 473 S.E.2d 676, 678 (1996), aff'd in part and vacated in part, 129 N.C.App. 374, 499 S.E.2d 771 (1998) (citation omitted).
Given these statutory distinctions between counties and area authorities and the waiver provisions of sections 122C-152(a) and 153A-435(a), plaintiff's allegation that OC has waived its immunity from suit by the purchase of liability insurance is insufficient to constitute a waiver of immunity by BHS. See id. (holding that, in light of these statutory distinctions and waiver provisions, an area authority's purchase of insurance does not result in a waiver of governmental immunity by a county ... the reverse of the factual situation in the present case). "Therefore, in the absence of an allegation in the complaint in a tort action against [a governmental unit], to the effect that such [unit] had waived its immunity by the procurement of liability insurance to cover such alleged negligence or tort, or that such [unit] has waived its immunity..., such complaint does not state a cause of action." Fields v. Board of Education, 251 N.C. 699, 701, 111 S.E.2d 910, 912 (1960). The trial court should have granted BHS' motion for judgment on the pleadings on the basis of governmental immunity because plaintiff's complaint failed to state a claim against this defendant.
Accordingly, for the aforementioned reasons, we reverse the trial court's denial of (I) OC's and DSS' motion for judgment on the pleadings based on res judicata and (II) BHS' motion for judgment on the pleadings based on governmental immunity.
Reversed.
Judges WALKER and McGEE concur.
