
411 S.E.2d 152 (1991)
NATIONWIDE MUTUAL INSURANCE COMPANY, Plaintiff,
v.
Robyn SILVERMAN, a minor child, By and Through her Guardian Ad Litem, Leesa RADJA, Defendant.
No. 9110SC99.
Court of Appeals of North Carolina.
December 17, 1991.
*153 Bailey & Dixon by Gary S. Parsons and David S. Coats, Raleigh, for plaintiff-appellant.
Taft, Taft & Haigler by Mario E. Perez, Greenville, for defendant-appellee.
WALKER, Judge.
This case arises out of a traffic accident in which defendant, a five-year-old child, was injured while a passenger in a 1985 Buick owned by Henry Peter Czubek (Czubek) and insured by plaintiff Nationwide Mutual Insurance Company (Nationwide). Nationwide began this action by filing a complaint seeking a declaration of the rights, status and relations of Nationwide and defendant under the policy. Specifically, Nationwide sought a judicial determination of the amount of underinsured motorist coverage (UIM) available to defendant. Defendant answered, joining Nationwide in seeking a declaration of the rights of the parties. The facts are not in dispute.
State Auto Insurance Company (State Auto) insured the other vehicle involved in the accident and provided liability coverage in the amount of $100,000 per accident. State Auto advanced its $100,000 policy limits to all claimants who were occupants in the Czubek vehicle. Defendant was allotted $37,500 of this sum but she claimed damages in excess of this amount.
At the time of the accident, Czubek's Nationwide policy covered two vehicles, the 1985 Buick involved in the accident and a 1977 Ford. This policy provided for UIM coverage in the amount of $100,000 per person and $300,000 per accident for both vehicles named in the policy.
The trial court granted judgment on the pleadings for defendant and allowed defendant to "stack" the UIM coverage on both Czubek vehicles so that a total of $200,000 in UIM insurance was available to defendant. On appeal to this Court, Nationwide assigns error to the trial court's order (1) allowing defendant to stack the UIM insurance coverage on both Czubek vehicles, and (2) granting the defendant judgment on the pleadings when the defendant did not move for such relief.

I.
Nationwide contends that defendant is limited to the UIM coverage of $100,000 on the vehicle she was occupying at the time of the accident. Stacking of UIM insurance coverage is governed by G.S. 20-279.21(b)(4), which in relevant part provides:
An "uninsured motor vehicle," as described in subdivision (3) of this subsection, includes an "underinsured highway vehicle," which means a highway vehicle with respect to the ownership, maintenance, or use of which, the sum of the limits of liability under all bodily injury liability bonds and insurance policies applicable at the time of the accident is less *154 than the applicable limits of liability under the owner's policy.... Underinsured motorist coverage shall be deemed to apply when, by reason of payment of judgment or settlement, all liability bonds or insurance policies providing coverage for bodily injury caused by the ownership, maintenance, or use of the underinsured highway vehicle have been exhausted. Exhaustion of such liability coverage for purpose of any single liability claim presented for underinsured motorist coverage shall be deemed to occur when either (a) the limits of liability per claim have been paid upon such claim, or (b) by reason of multiple claims, the aggregate per occurrence limit of liability has been paid. Underinsured motorist coverage shall be deemed to apply to the first dollar of an underinsured motorist coverage claim beyond amounts paid to the claimant pursuant to the exhausted liability policy.
In any event, the limit of underinsured motorist coverage applicable to any claim is determined to be the difference between the amount paid to the claimant pursuant to the exhausted liability policy and the total limits of the owner's underinsured motorist coverages provided in the owner's policies of insurance; it being the intent of this paragraph to provide to the owner, in instances where more than one policy may apply, the benefit of all limits of liability of underinsured motorist coverage under all such policies....
Our Supreme Court has decided under this statute that the owner of the insured vehicles can stack UIM coverage. See Sutton v. Aetna Casualty & Surety Co., 325 N.C. 259, 382 S.E.2d 759, reh'g denied, 325 N.C. 437, 384 S.E.2d 546 (1989). In a recent decision involving UIM coverage, the Supreme Court dealt with the question of who are "persons insured" under G.S. 20-279.21(b)(3). Here, the Court said:
the named insured and, while resident of the same household, the spouse of any such named insured and relatives of either, while in a motor vehicle or otherwise, and any person who uses with the consent, expressed or implied, of the named insured, the motor vehicle to which the policy applies and a guest in such motor vehicle to which the policy applies or the personal representative of any of the above or any other person or persons in lawful possession of such motor vehicle.... This section of the statute essentially establishes two "classes" of "persons insured": (1) the named insured and, while resident of the same household, the spouse of the named insured and relatives of either and (2) any person who uses with the consent, express or implied, of the named insured, the insured vehicle, and a guest in such vehicle.
Sproles v. Greene, 329 N.C. 603, 608, 407 S.E.2d 497, 500 (1991). Thus, according to the statute, the named insured and the spouse and relatives of the named insured while living in the same household are class one insureds and are covered for purposes of UIM coverage "while in a motor vehicle or otherwise." Class one insureds have UIM coverage even if they are not in a covered vehicle when injured. All other persons are class two insureds and are only covered while using "the motor vehicle to which the policy applies." Id.
This Court recently recognized that the stacking of coverage contemplated by G.S. 20-279.21(b)(4) flows further than to the named insured; family members of the same household of the named insured are also "persons insured." Manning v. Tripp, ___ N.C.App. ___, 410 S.E.2d 401 (1991); Amos v. North Carolina Farm Bureau Mutual Insurance Co., 103 N.C.App. 629, 406 S.E.2d 652 (1991); Harris v. Nationwide Mutual Insurance Co., 103 N.C.App. 101, 404 S.E.2d 499, review allowed, 329 N.C. 788, 408 S.E.2d 521 (1991).
In the present case defendant, as a guest in the Czubek vehicle, is likewise a "person insured" under G.S. 20-279.21(b)(3). Members of the second class are "persons insured" for purpose of UIM coverage only when the insured vehicle is involved in the insured's injuries while members of the first class are "persons insured" even where the insured vehicle is not involved in *155 the insured's injuries. Smith v. Nationwide Mutual Insurance Co., 328 N.C. 139, 400 S.E.2d 44, reh'g denied, 328 N.C. 577, 403 S.E.2d 514 (1991). This is the only distinction we find in this statute between class one "persons insured" and class two "persons insured." Once the claimant is a "person insured" the ability to stack UIM coverage is available to this claimant. There can be no artificial barriers imposed upon the privilege of stacking; once the claimant here established that she was a "person insured," then the privilege of stacking UIM coverage from both covered vehicles flowed to her. The decision of the trial court correctly recognized that Robyn Silverman, as a guest in the motor vehicle of the named insured, was a "person insured" and was entitled to stack the coverage from both Czubek vehicles totaling $200,000. See also Leonard v. North Carolina Farm Bureau Mutual Insurance Co., ___ N.C.App. ___, 411 S.E.2d 178 (1991).

II.
Lastly, Nationwide contends the Superior Court erred in granting judgment on the pleadings for defendant since she did not move for such relief. Here, both parties sought a declaratory judgment as no facts were in dispute. Nationwide asserted defendant was only entitled to $100,000 in UIM coverage while defendant contended she was entitled to UIM coverage of $200,000. The court, in denying Nationwide's motion for judgment on the pleadings, effectively determined defendant was entitled to a declaratory judgment. While it would have been the better practice for the trial court to grant this relief after defendant had so moved, it appears that granting judgment on the pleadings was harmless error because plaintiff was not prejudiced by this action.
Affirmed.
WELLS and LEWIS, JJ., concur.
