
854 P.2d 1352 (1992)
In re the MARRIAGE OF Mickie K. DURENO, Appellee, and
John B. Dureno, Appellant.
No. 92CA0740.
Colorado Court of Appeals, Div. I.
December 17, 1992.
Rehearing Denied January 28, 1993.
Certiorari Denied July 6, 1993.
*1353 Litvak and Litvak, P.C., Ronald D. Litvak, Denver, for appellee.
Jennifer A. Rivera, P.C., Jennifer A. Rivera, Denver, for appellant.
Opinion by Chief Judge STERNBERG.
This appeal concerns the authority of the trial court in a dissolution of marriage proceeding to award visitation to someone other than a natural or adoptive parent of a minor child. The trial court held there was no legal basis to award visitation under such circumstances. We disagree and therefore we vacate the trial court's order and remand for further proceedings.
This case, which originated as a dissolution of marriage action, evolved into an annulment and paternity proceeding. In September 1990, Mickie K. Dureno (wife) sought a dissolution of the marriage between her and John B. Dureno (husband). Wife's dissolution petition alleged that the parties were married in November 1987 and that a daughter, the child at issue here, had been born in May 1989, during the marriage. The parties stipulated to temporary *1354 orders granting husband visitation with the child and requiring him to pay child support.
Shortly thereafter, the wife repudiated husband's paternity and obtained a court order requiring the parties to submit to blood tests to determine paternity. The tests proved conclusively that husband was not the child's biological father.
Wife thereupon filed a motion for summary judgment declaring the husband's non-paternity. In response, husband stipulated that he was not the child's biological father, but he asserted that he had assumed responsibility for the child "emotionally, physically and financially" since her birth and alleged that he and the child share a warm and loving relationship. Husband argued that he stood in loco parentis to the child and that, as a "psychological parent," he was entitled to visitation and that it would be detrimental to the child to sever their relationship.
Based on the husband's stipulation of non-paternity, the trial court, on July 10, 1991, entered summary judgment declaring the nonexistence of a father-child relationship between the husband and the child. At the same time, on the motion of both parties, the trial court ordered a custody evaluation and reserved jurisdiction to decide visitation. Husband continued to see the child under the visitation provisions of temporary orders previously entered.
In the interim, husband had moved to amend his response to the dissolution petition. The motion requested that, instead of a dissolution decree, the court enter a Declaration of Invalidity pursuant to § 14-10-111(1)(g)(I), C.R.S. (1987 Repl.Vol. 6B). In support of his motion, husband provided documentation showing that wife was not legally divorced from her previous husband when the parties were married in 1987.
In an off-the-record hearing on March 4, 1992, the court concluded that since husband was not the child's natural or adoptive father and the parties were never validly married, there was no legal basis for awarding visitation to the husband. The court therefore terminated husband's temporary visitation rights and dismissed the action.

I.
Initially, we address the validity of the order entered on July 10, 1991, declaring the nonexistence of a father-child relationship between the husband and the child. We conclude that the judgment is subject to attack or direct appeal and therefore remand the cause for further proceedings.
This court may sua sponte consider the district court's lack of subject matter jurisdiction notwithstanding the parties' failure to raise the issue. Sullivan v. Board of County Commissioners, 692 P.2d 1106 (Colo.1985).
When a paternity issue is raised in dissolution proceedings, the adjudication of paternity must be made according to the specific provisions of the Uniform Parentage Act, § 19-4-101, et seq., C.R.S. (1992 Cum.Supp.). Under the U.P.A., the child is an indispensable party to a paternity proceeding, and, unless he or she can be made a party, the trial court is without jurisdiction to resolve any matters pertaining to paternity. Smith v. Casey, 198 Colo. 433, 601 P.2d 632 (1979); see also M.R.D. v. F.M., 805 P.2d 1200 (Colo.App.1991).
On July 10, 1991, when the order was entered, the child was not represented by a guardian ad litem and was not before the court as a proper party plaintiff. See § 13-22-101(1)(c), C.R.S. (1987 Repl.Vol. 6A); C.R.C.P. 17(c). Therefore, the cause must be remanded to the trial court to conduct the necessary proceedings pursuant to the U.P.A. See In re Marriage of Burkey, 689 P.2d 726 (Colo.App.1984).

II.
Because the matter of visitation by husband will likely arise on remand, we address, as a matter of first impression, whether visitation rights may be awarded a third-party who is neither a natural nor an adoptive parent. We conclude that such an order is permissible under some circumstances, one of which is that it will serve the best interests of the child.
*1355 The husband argues that visitation by a stepparent or surrogate parent should not be precluded as a matter of law, and he urges us to follow courts in other jurisdictions which have approved nonparent visitation when it is in the child's best interest.
It is the law in Colorado that custody may be awarded to a person other than a natural parent if such an award is in the best interest of the child. Root v. Allen, 151 Colo. 311, 377 P.2d 117 (1962); see also Abrams v. Connolly, 781 P.2d 651 (Colo.1989). Indeed, the statute governing custody specifically provides that a custody proceeding may be commenced by "a person other than a parent" in certain circumstances. Such custody may be sought:
(b) By a person other than a parent, by filing a petition seeking custody of the child in the county where the child is permanently resident or where he is found, but only if the child is not in the physical custody of one of his parents; or
(c) By a person other than a parent who has had physical custody of a child for a period of six months or more, if such action is commenced within six months of the termination of such physical custody.
Section 14-10-123(1), C.R.S. (1987 Repl.Vol. 6B).
Similarly, the Uniform Child Custody Jurisdiction Act, § 14-13-102, et seq., C.R.S. (1987 Repl.Vol. 6B), authorizes the trial court to adjudicate custody disputes involving parties other than biological or adoptive parents. See In re Marriage of Tricamo, 42 Colo.App. 493, 599 P.2d 273 (1979).
However, in contrast to the above statutes relating to custody, the statute which addresses visitation contains more restrictive language: it speaks of awards being made to natural and adoptive "parents." Section 14-10-129, C.R.S. (1987 Repl.Vol. 6B), provides in pertinent part:
A parent not granted custody of the child is entitled to reasonable visitation rights.... [T]he court shall not restrict a parent's visitation rights unless it finds that the visitation would endanger the child's physical health or significantly impair his emotional development.
Relying on this use of the word "parent," wife asserts that the right to visitation is limited under § 14-10-129 to persons having a blood or adoptive relationship with the minor child. She argues that, in contrast to the custody statute, § 14-10-129 precludes third-party visitation as a matter of law. We disagree and hold that such a narrow interpretation of the statute would be contrary to the public policy of this state.
The various parts of the Uniform Dissolution of Marriage Act, § 14-10-101 et seq., C.R.S. (1987 Repl.Vol. 6B), must be read in pari materia and construed to effect the strong public policies underlying the Act. See Alias Smith & Jones, Inc. v. Barnes, 695 P.2d 302 (Colo.App.1984).
When statutes on the same subject are potentially conflicting, the court must reconcile them, if possible, to avoid an inconsistent or absurd result. The Colorado and Southern Railway Co., Inc. v. District Court, 177 Colo. 162, 493 P.2d 657 (1972). In interpreting a statute we must be aware of the consequences of a particular construction. Section 2-4-203(1)(e), C.R.S. (1980 Repl.Vol. 1B).
The right to visitation is derived from the right to custody and is governed by the same legal principles. See § 14-10-124, C.R.S. (1987 Repl.Vol. 6B); In re Marriage of Sepmeier, 782 P.2d 876 (Colo.App.1989); In re Marriage of Adamson, 626 P.2d 739 (Colo.App.1981). Thus, it would be inconsistent, if not absurd, to hold that a stepparent or other third-party is entitled under one section of the Act to an award of legal custody, but has no right of visitation under another section of the Act.
We note that prior to the adoption of the Uniform Dissolution of Marriage Act in 1971, see Colo.Sess.Laws 1971, ch. 130, p. 520, there was no statutory authority for the award of visitation upon divorce or annulment. See, e.g., C.R.S.1963, 46-1-1, et seq.; 46-3-1, et seq. Rather, Colorado courts prior to the dissolution of marriage act granted visitation as part of their *1356 broader authority to determine custody in the best interest of the child. See Breene v. Breene, 51 Colo. 342, 117 P. 1000 (1911); McKercher v. Green, 13 Colo.App. 270, 58 P. 406 (1899).
This court has previously ruled that adoption of the UDMA in 1971 did not alter the traditional authority of Colorado courts to award custody to third parties in dissolution actions. In re Marriage of Trouth, 631 P.2d 1183 (Colo.App.1981). Additionally, we note that the supreme court has ruled that the "affinal" relationship between stepparent and stepchild is not automatically terminated by dissolution of the marriage between the natural parent and the stepparent. In re Estate of Iacino, 189 Colo. 513, 542 P.2d 840 (1975).
Therefore, we are not persuaded that § 14-10-129 was adopted for the purpose of restricting visitation to natural and adoptive "parents." The Uniform Marriage and Divorce Act, the model act on which the Colorado Dissolution of Marriage Act is based, indicates that Section 407, the section from which § 14-10-129 is derived, was devised to guarantee that a non-custodial parent would not be denied visitation privileges unless visitation would seriously endanger the child. There is no indication that the section was intended to restrict visitation to natural and adoptive parents. See 9A Uniform Law Annot., Uniform Marriage and Divorce Act § 407 at 612 (1971) (Commissioner's Note).
Furthermore, courts in other jurisdictions, construing statutes similar to § 14-10-129 have adopted this interpretation and have refused to disallow stepparent visitation based solely on the terminology of the statute. See Carter v. Brodrick, 644 P.2d 850 (Alaska 1982); Bryan v. Bryan, 132 Ariz. 353, 645 P.2d 1267 (App.1982); Simpson v. Simpson, 586 S.W.2d 33 (Ky.1979); see also In re Custody of D.M.M., 137 Wis.2d 375, 404 N.W.2d 530 (Wis.1987).
The jurisdictions that have permitted stepparent visitation in the absence of clear statutory authority have done so on the basis of the child's best interest. As stated by the Superior Court of Pennsylvania:
Clearly a stepfather and his young stepchildren who live in a family environment may develop deep and lasting mutual bonds of affection. Courts must acknowledge the fact that a stepfather (or stepmother) may be the only parent that the child has truly known and loved during its minority. A stepparent may be as devoted and concerned about the welfare of a stepchild as a natural parent would be. Rejection of visitation privileges cannot be grounded in the mere status as a stepparent.
Spells v. Spells, 250 Pa.Super. 168, 378 A.2d 879, 881 (1977);
Visitation is not solely for the benefit of the adult visitor but is aimed at fulfilling what many conceive to be a vital, or at least a wholesome contribution to the child's emotional well being by permitting partial continuation of an earlier established close relationship.
Looper v. McManus, 581 P.2d 487, 488 (Okla.Ct.App.1978); see also Carter v. Brodrick, supra; Bryan v. Bryan, supra; Wills v. Wills, 399 So.2d 1130 (Fla.App.1981); Simpson v. Simpson, supra; Evans v. Evans, 302 Md. 334, 488 A.2d 157 (1985); Atkinson v. Atkinson, 160 Mich.App. 601, 408 N.W.2d 516 (1987); Klipstein v. Zalewski, 230 N.J.Super. 567, 553 A.2d 1384 (Ch.Div.1988); Gribble v. Gribble, 583 P.2d 64 (Utah 1978); Honaker v. Burnside, 182 W.Va. 448, 388 S.E.2d 322 (1989). But see In re Marriage of Gayden, 229 Cal.App.3d 1510, 280 Cal.Rptr. 862 (Cal.Ct.App.1991); In re Marriage of Freel, 448 N.W.2d 26 (Iowa 1989); Ronald F.F. v. Cindy G.G., 70 N.Y.2d 141, 517 N.Y.S.2d 932, 511 N.E.2d 75 (N.Y.1987); Cooper v. Merkel, 470 N.W.2d 253 (S.D.1991).
We find the cases allowing step-parent visitation to be both persuasive and consonant with the policy in Colorado of safeguarding the best interest of the child.
One of the enunciated purposes of the dissolution of marriage act is to mitigate the harm to minor children arising out of the termination of a marriage. Section 14-10-102, C.R.S. (1987 Repl.Vol. 6B). Also, Colorado courts have long recognized that in matters of child custody and visitation, *1357 the rights and wishes of the parents must be subordinated to the child's paramount interests and needs. Coulter v. Coulter, 141 Colo. 237, 347 P.2d 492 (1959). This principle is now codified at § 14-10-123.4, C.R.S. (1987 Repl.Vol. 6B), which provides that children have the "right" to have custody determinations based on their welfare and best interest. See In re Marriage of Murphy, 834 P.2d 1287 (Colo.App.1992); Bernick v. Bernick, 31 Colo.App. 485, 487, 505 P.2d 14, 15 (1972) (visitation is "primarily a right of the children and secondarily a right of the [parents]").
Therefore, we hold that the trial court in a dissolution of marriage proceeding may grant visitation privileges to a stepparent or surrogate parent under the following conditions: (1) the nonparent is jurisdictionally capable of litigating custody under § 14-10-123(1), C.R.S. (1987 Repl.Vol. 6B); (2) the nonparent has acted in a custodial and parental capacity toward the minor child; and (3) visitation would be in the minor child's best interest.
The record reflects that the husband had physical custody of the child jointly with the wife, from the date of the child's birth to a period within six months from the date of his response to wife's petition for dissolution. Therefore, husband was jurisdictionally capable of litigating custody under § 14-10-123(1)(c). See In re Marriage of Tricamo, supra.
Further, an annulment proceeding is an action under the dissolution of marriage act and is governed by the same statutory provisions which apply to dissolution proceedings. See § 14-10-111(6), C.R.S. (1987 Repl.Vol. 6B). Therefore, the husband's post-petition motion for a declaration of invalidity did not affect his standing to litigate custody and visitation.
As to the best interests requirement, we note that both the guardian ad litem and the court-appointed custody evaluator recommended that it was in the child's best interest for her to have continuing visitation with the husband.
Under this state of the record, the trial court erred in dismissing the action as a matter of law, and the case must be remanded for an evidentiary hearing and a reevaluation of visitation. Although we are vacating the summary dismissal order, we express no opinion on the merits of the husband's visitation request.
In determining whether, and to what extent to grant nonparent visitation, the trial court should be guided by the statutory factors set forth in the best interest standard under § 14-10-124, C.R.S. (1987 Repl.Vol. 6B). In addition, however, the court should consider the wishes of the child's natural parent, the child's age, the nature and length of the relationship between the child and the nonparent, and the extent to which the child's well-being will be served by granting the nonparent visitation. With these factors in mind, the court may conclude that it would be against the best interests of the child to enforce visitation or it may conclude otherwise. See Shoemaker v. Shoemaker, 563 So.2d 1032 (Ala.Civ.App.1990); Wills v. Wills, supra.
The paternity order of July 10, 1991, and the order dismissing husband's request for visitation are vacated, and the cause is remanded to the trial court for further proceedings consistent with this opinion.
NEY and DAVIDSON, JJ., concur.
