#### In re CUSTODY OF K.P.L., a Minor (Christopher M.L., Petitioner and Counterrespondent-Appellant, v. Kenjula L.L. et al., Respondents-Appellees; (Gary L.G. et al., Counterpetitioners-Appellees; Kenjula L.L., Counterrespondent)).—In re CUSTODY OF K.P.L., a Minor (Christopher M.L., Appellant, v. Kenjula L.L. et al., Appellees).

Third District

Nos. 2—97—1107, 3—98—0066 cons.

Opinion filed April 16, 1999.

Rehearing denied June 11, 1999.

*482SLATER, J., specially concurring.

M. Allyson Misevich (argued), of Rockford, for appellant.

Michelle B. Buckwalter (argued), of Weinstine, Shirk & Buckwalter, of Morrison, for appellees.

James E Heuerman, of Morrison, guardian ad litem.

*483JUSTICE BRESLIN

delivered the opinion of the court:

Christopher M.L. (Christopher) challenges the trial court’s decision in a custody case filed under section 601 of the Illinois Marriage and Dissolution of Marriage Act (Act) (750 ILCS 5/601(b)(2) (West 1996)). In the court below, Christopher petitioned for custody of his minor son (Baby K), while Baby K’s legal guardians, Gary L.G. (Gary) and Cheryl A.G. (Cheryl), counterpetitioned. The court awarded custody to Gary and Cheryl based solely upon a best interest analysis. On appeal, Christopher contends that (1) Gary and Cheryl did not have standing to petition for custody, and (2) the court’s failure to vacate Gary and Cheryl’s guardianship and the subsequent grant of custody to Gary and Cheryl were against the manifest weight of the evidence. Pursuant to the following discussion, we affirm. In so doing, we hold that Christopher waived any objection that he had concerning Gary and Cheryl’s standing by not properly raising the issue as an affirmative defense in a motion to dismiss during the time of the pleadings.

BACKGROUND

In compiling this factual summary, we have relied extensively on the exposition of the facts as detailed in the trial court’s order. Christopher and Kenjula L.L. (Kenjula) began a relationship when she was approximately 14 years old and he was approximately 17 years old. The relationship was tumultuous, characterized by incidences of physical violence by Christopher toward Kenjula.

In April of 1994, when Christopher was charged with aggravated criminal sexual abuse of a minor, Kenjula terminated her relationship with him. She then began a relationship with Chris G. (C.G.), who was 16 years old at the time. Kenjula was 17 years old. Shortly after beginning this new relationship, Kenjula discovered that she was pregnant. When Christopher discovered the pregnancy and questioned Kenjula about it, Kenjula told him that C.G. was the father. During this time period, Christopher’s charge for aggravated criminal sexual abuse was pending. In July of 1994, Christopher failed to appear in court for a sentencing hearing and fled to the State of Iowa.

Baby K was born in December of 1994. His birth certificate gave him Kenjula’s last name and failed to list a father. Christopher returned to the State of Illinois and was incarcerated in February of 1995. He was sentenced in March and completed his prison sentence in May of 1995. After his release from custody, Christopher wished to prove himself to be Baby K’s father. He could not, however, afford an attorney nor did he have the money to obtain blood tests. In the hope of receiving a free paternity test, he contacted the Jerry Springer *484Show. Kenjula and C.G. agreed to appear on the show and Christopher saw Baby K for the first time at that show. However, the show failed to conduct a paternity test.

At various times in 1995, Kenjula, C.G. and Baby K lived with C.G.’s parents, Gary and Cheryl. Bécause Kenjula was not providing sufficient care for Baby K, Gary and Cheryl began to provide increasing amounts of care for him themselves. Kenjula testified that C.G. knew from the beginning that he was not Baby K’s father. Gary and Cheryl also testified that they doubted their son was Baby K’s father and knew that Christopher was asking for blood tests to determine his paternity. Nonetheless, they claimed they did not know the identity of Baby K’s father.

Sometime in 1995, Kenjula became pregnant with C.G’s child. By March of 1996, however, Kenjula had ended her relationship with C.G. and was living in a motel room with her two children. Subsequently, with Kenjula’s permission, Christopher visited Baby K. Cheryl also visited Kenjula and the two children. Cheryl testified that the children were filthy and crawling with insects. She asked to take the children home with her because of the deplorable conditions in which the children were living. Kenjula consented and Cheryl took them to her home. After cleaning them up, Cheryl decided that she would not let the children go back to the motel.

Kenjula agreed to allow the children to remain with Gary and Cheryl for an extended period of time. Gary and Cheryl then petitioned for guardianship of both Baby K and his little brother, stating that they were the children’s paternal grandparents. Kenjula and C.G. stated that they were the parents of both children and consented to Gary and Cheryl being given guardianship. Christopher was given no notice of the guardianship proceedings and the court was not informed that Christopher was possibly the father of Baby K. Gary and Cheryl were named legal guardians of Baby K and his little brother in July of 1996.

When Christopher was finally able to hire an attorney, he filed a paternity action and blood tests were ordered. In November of 1996, Christopher was found to be the father of Baby K. Baby K’s birth certificate was amended to list his last name as that of Christopher and to name Christopher as his father.

Christopher filed the present custody action in January of 1997. In his petition, Christopher alleged that he had sought to establish a parent-child relationship with his child but was prohibited from doing so by Kenjula and Gary and Cheryl. He alleged that Gary and Cheryl were not related to Baby K and that they had obtained guardianship by the false assertion that they were Baby K’s paternal grandparents. *485Further, he alleged that he was not given notice of the guardianship proceedings and that he was willing, able and fit to take custody of Baby K. He asked the court to vacate Gary and Cheryl’s guardianship and to grant him custody of Baby K.

In their answer, Gary and Cheryl admitted that Christopher was Baby K’s natural father and that they were not related to Baby K, but they denied having obtained guardianship based on false information. Gary and Cheryl counterpetitioned for custody, claiming that Baby K had resided with them since May of 1996 and that he continued to reside with them. In their counterpetition, Gary and Cheryl alleged that Baby K was not in the physical custody of either of his parents. In his answer to the counterpetition, Christopher admitted this allegation. In addition, Christopher failed to assert any affirmative defenses to Gary and Cheryl’s counterpetition.

Among other evidence presented at trial, Gary and Cheryl testified that Baby K was active in Sunday school. They further testified that he had developed a close relationship with his half-brother. Gary and Cheryl also explained that they were providing Baby K with the stable and loving environment that he had been deprived of during the first 15 months of his life.

In addition, Christopher testified that, since his release from prison, he has moved to Iowa and been in compliance with all the terms of his release. He further testified that he has not been without employment. At the time of the trial, Christopher was about to begin a job that he hoped would provide him steady work in a place of employment where his aunt also worked. Christopher’s aunt agreed to help him take care of Baby K.

The court granted Gary and Cheryl custody. In its ruling, the court focused on Baby K’s best interests and found compelling evidence that granting custody to Gary and Cheryl was in Baby K’s best interests. The court also found compelling evidence that Christopher had made positive changes in his life and determined that if the positive trend continued, it was in Baby K’s best interests to allow Christopher to establish a father and son relationship with him.

On appeal, Christopher alleges that (1) Gary and Cheryl did not have standing to petition for custody, and (2) the court’s failure to vacate Gary and Cheryl’s guardianship and the subsequent grant of custody to Gary and Cheryl were against the manifest weight of the evidence.

Other relevant facts will be discussed as they become necessary to our analysis.

ANALYSIS

Through this case, we are presented with a rather straightforward *486legal issue made extremely difficult by the delicate nature of the underlying factual situation within which it is presented. Technically, we are asked to determine whether it is possible for a parent to waive his or her right to challenge a nonparent’s standing or whether non-parents have an affirmative duty to prove their standing under the Act. More importantly, however, we are asked to render a decision on a trial court’s order concerning the best interests of Baby K — a child who sadly has been subjected to an inordinate amount of disarray and turmoil for someone of his tender age. Given the sensitivity of our task, we will address each of these separate concerns in turn.

I. Standing

Christopher argues that Gary and Cheryl lacked the requisite standing under section 601(b)(2) of the Act (750 ILCS 5/601(b)(2) (West 1996)) to file their counterpetition for custody of Baby K. In response, Gary and Cheryl contend that Christopher waived any right to challenge their standing by not properly raising the issue below. We agree with Gary and Cheryl that, under existing case law, Christopher waived the issue of standing.

Lack of standing under section 601(b)(2) of the Act is an affirmative defense that is waived unless raised in a motion to dismiss during the time of the pleadings. In re Marriage of Houghton, 301 Ill. App. 3d 775, 704 N.E.2d 409 (1998); In re Marriage of Schlam, 271 Ill. App. 3d 788, 648 N.E.2d 345 (1995); In re Marriage of Sechrest, 202 Ill. App. 3d 865, 560 N.E.2d 1212 (1990); In re Custody of McCarthy, 157 Ill. App. 3d 377, 510 N.E.2d 555 (1987). The purpose behind this waiver doctrine is to preserve finite judicial resources by creating an incentive for litigants to bring issues to the courts’ attention, thereby giving courts an opportunity to consider those issues. Schlam, 271 Ill. App. 3d at 796-97, 648 N.E.2d at 351.

In the present case, it is clear that Christopher did not include as part of his pleadings the affirmative defense of lack of standing. Nor did he file a motion to dismiss for lack of standing in answer to the Gary and Cheryl’s counterpetition for custody. Although the statement in Christopher’s custody petition that he had continually sought to establish a parent-child relationship with Baby K could be construed as raising the issue of standing, the record is devoid of any argument on the issue whatsoever by either of the parties or any reference to the issue by the trial court. Hence, there is no indication that either of the parties or the trial court believed that Christopher had raised the issue in his pleadings. The first and only time that Christopher unequivocally raised Gary and Cheryl’s alleged lack of standing was in his briefs to this court. As a result, we are compelled by the well-*487settled authority cited above to conclude that Christopher waived his right to challenge Gary and Cheryl’s standing.

We fully recognize that our decision on this issue is somewhat weakened by the fact that a rather distinct incongruity exists between the wording of the Act and the case law on standing. Ultimately, however, we do not believe that this discrepancy warrants a different outcome in the case at hand.

As noted above, the case law unequivocally considers standing to be an affirmative defense, squarely placing the initial burden upon the parent to raise the issue and deeming the issue waived if not so raised. Nevertheless, the Act provides that a nonparent can file a petition for custody “only if [the child] is not in the physical custody of one of his parents.” 750 ILCS 5/601(b)(2) (West 1996). This requirement places the burden upon the nonparent to show that the parent has somehow voluntarily and indefinitely relinquished custody of the child. In re Petition of Kirchner, 164 Ill. 2d 468, 649 N.E.2d 324 (1995).

The apparent reason for this divergence is that the courts have interpreted lack of standing under the Act as one of the many affirmative defenses subject to section 2—619(a)(9) of the Code of Civil Procedure (Code) (735 ILCS 5/2—619(a)(9) (West 1996)). It is this provision of the Code which requires that affirmative defenses be raised in a motion to dismiss “within the time for pleading.” 735 ILCS 5/2—619(a) (West 1996). One could argue, however, that the Act itself places the burden upon the nonparent seeking custody. But, if the legislature truly intended to place the burden of proving standing solely upon a nonparent, we believe that one of two things would be true: either (1) the Act would contain language requiring the trial court to raise standing sua sponte if the issue is not raised by the parties or (2) the Act would contain language providing that lack of standing should not be treated as an affirmative defense under section 2—619 of the Code. Absent such language and in the face of the numerous decisions that interpret lack of standing as an affirmative defense under section 2—619(a) of the Code, we find no justifiable reason for rendering a decision contrary to such well-settled authority. If the legislature would require something else of us, we invite such direction in the form of an amendment to the Act.

II. Merits

We now turn to Christopher’s argument that the court’s failure to vacate Gary and Cheryl’s guardianship and the subsequent grant of custody to Gary and Cheryl were against the manifest weight of the evidence.

The primary consideration in any custody dispute is the best *488interests and welfare of the child. In re Marriage of Quindry, 223 Ill. App. 3d 735, 585 N.E.2d 1312 (1992). In general, the trial court has wide discretion to determine custody issues because it is in the best position to judge the credibility and demeanor of witnesses and assess the needs of the child. Gren v. Gren, 59 Ill. App. 3d 624, 375 N.E.2d 999 (1978). Hence, the trial court’s custody determination will not be disturbed on review unless it is against the manifest weight of the evidence. In re Marriage of Karonis, 296 Ill. App. 3d 86, 693 N.E.2d 1282 (1998). A judgment is against the manifest weight of the evidence when an opposite conclusion is apparent or when the findings appear to be unreasonable, arbitrary or not based on the evidence. In re Marriage of Hefer, 282 Ill. App. 3d 73, 667 N.E.2d 1094 (1996).

Upon a careful review of the record, we cannot say that the trial court’s decision was against the manifest weight of the evidence. At the time of the trial, Baby K had been living with Gary and Cheryl for 18 months after spending the first 15 months of his life in deplorable conditions with a person who was obviously not prepared to be a mother. It is clear that the trial court was convinced, as are we, that Gary and Cheryl have provided Baby K with a stable and loving environment. Moreover, by living with Gary and Cheryl, Baby K was, and continues to be, given the important opportunity to develop a relationship with his younger half-brother.

Since his release from prison, it appears that Christopher has earnestly attempted to lead a better life. While acknowledging this fact, the trial court also was obviously apprehensive about granting custody to him given that the quality of care he will be able to offer Baby K is unknown. Although Christopher is Baby K’s natural father, and as such has a paramount right to his custody, that right cannot be used to override Baby K’s best interests. We agree with the trial court that Baby K’s best interests will be served by Gary and Cheryl’s continued custody of him. Therefore, we affirm the trial court’s decision including that portion which reserves the issue of Christopher’s visitation schedule until his employment status and living arrangements are better known.

For the reasons stated above, the judgment of the circuit court of Whiteside County is affirmed.

Affirmed.

LYTTON, J., concurs.

JUSTICE SLATER,

specially concurring:

I write separately to emphasize that Christopher, under the cir*489cumstances, did everything he could possibly do in order to gain lawful custody of his son. Gary and Cheryl filed for guardianship of Baby K three months after Christopher filed his paternity action, and they intentionally failed to notify Christopher. They obtained their ■guardianship under false pretenses.

Unfortunately, application of existing law to this set of facts leads to the inevitable conclusion that Gary and Cheryl’s deceit overcomes the sincere honest efforts of the natural parent who worked within the bounds of the law. Once “standing” is established under these facts, it is unlikely that the natural parent will ever prevail under the best interests test.