Appeal from a judgment of the Supreme Court (Relihan, Jr., J.), entered September 7, 2006 in Tompkins *1236County, which, among other things, granted petitioners’ application, in a combined proceeding pursuant to CPLR article 78 and action for declaratory judgment, to declare invalid certain fees charged to petitioner Southern Cayuga Lake Intermunicipal Water Commission by respondent County of Tompkins.
Petitioner Southern Cayuga Lake Intermunicipal Water Commission (hereinafter SCLIWC) oversees the maintenance and operation of a large community water system that supplies potable water to several municipalities in Tompkins County. Respondent County of Tompkins, through its Department of Health, regulates SCLIWC and over 100 other such community water systems of varying size throughout the county, and imposes fees for its regulatory services. After the fee imposed upon SCLIWC increased dramatically due to the use of a new sliding scale fee schedule designed to recoup 20% of the costs of those services in 2004, 2005 and 2006, petitioners commenced this combined CPLR article 78 proceeding and action for declaratory judgment seeking a declaration that the fees for all three years were invalid. Respondents served a cross complaint to collect the amount due and moved for summary judgment. Supreme Court denied respondents’ motion and granted petitioners’ application, prompting this appeal by respondents.
We find merit in respondents’ argument that this proceeding was not timely commenced as to the fees imposed in 2004 and 2005 because petitioners’ claims as to them were not timely interposed in a CPLR article 78 proceeding. Fee setting by municipal agencies was once deemed a legislative act and declaratory judgment was the proper means of review (see e.g. Matter of Torsoe Bros. Constr. Corp. v Board of Trustees of Inc. Vil. of Monroe, 49 AD2d 461, 463 [1975]). Now, however, fee setting is correctly viewed as a quasi-legislative act of an administrative agency and the proper review procedure depends on the nature of the challenge raised (see New York City Health & Hosps. Corp. v McBarnette, 84 NY2d 194, 204-205 [1994]; Matter of Grand Manor Nursing Home Health Related Facility, Inc. v Nov ello, 39 AD3d 1062, 1064 [2007], lv denied 9 NY3d 812 [2007]; Trager v Town of Clifton Park, 303 AD2d 875, 877-878 [2003]). Here, petitioners’ claim was upheld by Supreme Court on the ground that the sliding scale feature of respondents’ fee schedule is illegal because it has not been shown to be reasonably related to the services provided to SCLIWC. Since such a claim comes under CPLR 7803 (3), petitioners were required, but failed, to contest the 2004 and 2005 fees in a timely CPLR article 78 proceeding.
*1237We also agree with respondents that they did not waive the statute of limitations defense. While they did not raise the defense in a pre-answer motion or their answer (see CPLR 3211 [e]), they did assert it in a motion for summary judgment made within a week of their answer. This effectively retracted the waiver (see Lerwick v Kelsey, 24 AD3d 918, 919-920 [2005], lv denied 6 NY3d 710 [2006]; Sheils v County of Fulton, 14 AD3d 919, 921 [2005], lv denied 4 NY3d 711 [2005]) and, because petitioners’ claims with respect to the 2004 and 2005 fee schedules are time-barred, there must be a dismissal as to those claims.
We are unpersuaded, however, by respondents’ argument that their sliding scale imposes a valid fee. While there can be no doubt that respondents’ power to regulate water systems includes the authority to charge fees, those fees are restricted to the cost of the service provided to those being regulated (see City of Buffalo v Stevenson, 207 NY 258, 262-263 [1913]; Jewish Reconstructionist Synagogue of N. Shore v Incorporated Vil. of Roslyn Harbor, 40 NY2d 158, 162-163 [1976]). “[W]here a fee is properly imposed, the amount thereof must be based on reliable factual studies and statistics and must bear a reasonable correlation to the average, associated cost of the service provided” (Matter of Phillips v Town of Clifton Park Water Auth., 286 AD2d 834, 835 n [2001], lv denied 97 NY2d 613 [2002]). “Exact congruence ... is not required ... so long as there exists some rational underpinning for the charges levied” (Watergate II Apts. v Buffalo Sewer Auth., 46 NY2d 52, 59 [1978] [citations omitted]).
Here, Supreme Court correctly found that respondents’ sliding scale, which is based on the population of consumers served by each of the systems being regulated, lacks the requisite relationship to respondents’ cost of providing services to SCLIWC. Briefly stated, the sliding scale was created by dividing the 111 community water systems benefitting from respondents’ services into seven groups based upon the size of the populations served by each such system and then allocating the total costs to be recouped according to each group’s midrange population. The record shows that, while an equal division of the total costs to be recouped in 2004 would yield a fee of $329 for each of the 111 systems, the sliding scale assessed fees ranging from $105 to $6,730. The avowed goal of setting different fees for the different groups was to yield a hypothetically equal cost to each of the consumers served by each system, apparently assuming that each system’s fee would be divided equally among its population of consumers. This apportionment of costs based on the size of
*1238the population served, however, does not assess fees in proportion to the cost of the regulatory services provided to each system. As Supreme Court observed, it may be possible for respondents to show that the regulatory services provided to each system actually varied in direct proportion to the size of the population served, but they failed to do so here. Thus, the court properly granted the petition as to the 2006 fee.
Crew III, J.P., Peters, Mugglin and Kane, JJ., concur. Ordered that the judgment is modified, on the law, without costs, by reversing so much thereof as denied respondents’ motion for summary judgment as to the fees imposed for 2004 and 2005; motion granted to that extent and said claims dismissed; and, as so modified, affirmed.