
826 A.2d 58 (2003)
The BOROUGH OF NANTY GLO, a body politic, Appellant,
v.
Robert D. FATULA, Sr., an individual, and Ronald D. Brown, an individual.
Commonwealth Court of Pennsylvania.
Submitted on Briefs May 7, 2003.
Decided June 9, 2003.
*59 Suzann M. Lehmier, Johnstown and Robert J. Garvin, Pittsburgh, for appellant.
William Gleason Barbin, Johnstown, for appellees.
BEFORE: LEADBETTER, Judge, and SIMPSON, Judge, and FLAHERTY, Senior Judge.
OPINION BY Senior Judge FLAHERTY.
The Borough of Nanty Glo (Borough) appeals from an order of the Court of Common Pleas of Cambria County (trial court) which sustained the Preliminary Objections of Robert D. Fatula, Sr. (Fatula) and Ronald D. Brown (Brown) (collectively, "Appellees") and dismissed the Action for Declaratory Judgment filed by the Borough. We affirm.
On July 29, 2002, the Borough filed an Action for Declaratory Judgment. In its Complaint, the Borough alleges that, on January 13, 1986, the Nanty Glo Borough Council enacted Ordinance No. 417, which established a Police Pension Plan for all full time officers in the Borough in accordance with the provision of what is commonly called "Act 600".[1] Section 1(a) of Act 600 provides, in relevant part, that:
Each borough, town and township of this Commonwealth maintaining a police force of three or more full-time members and each regional police department shall, and all other boroughs, towns or townships may, establish, by ordinance or resolution, a police pension fund or pension annuity to be maintained by a charge against each member of the police force, by annual appropriations made by the borough, town, township or regional police department, by payments made by the State Treasurer to the municipal treasurer from the moneys received from taxes paid upon premiums by foreign casualty insurance companies for purposes of pension retirement for policemen, and by gifts, grants, devises or bequests granted to the pension fund pursuant to section two of this act.
53 P.S. § 767(a)(2). Because the Borough had three full-time officers, it was required to establish a pension fund in accordance with Act 600. Two of those officers were Brown and Fatula, the Appellees in this case.
In 1992, as Appellees approached retirement, the Borough and their pension consultant at that time decided to change from an Act 600 Plan to what is commonly called an "Act 120" Plan[2] because Appellees were the only members of the Borough Police Department. Act 120 provides, in relevant part, that:
Every municipality or county which makes application and certifies that it has a police force comprising at least one full-time paid policeman, but which *60 does not have a Municipal Employes' Retirement Fund, a Police Pension or Retirement Fund, as provided in section one of this act, shall be paid in the manner provided in this act the amount that would be allocated had the municipality or county made provision through a Municipal Employes' Retirement Fund, a Police Pension or Retirement Fund, all of which sum so allocated shall be expended by the municipal or county authorities to secure Pension Annuity Contracts for their policemen. Warrants for this purpose shall be drawn by the Auditor General payable to the treasurers of the Municipalities or counties, and the municipal or county authorities are hereby directed to use the allocations to forthwith secure Pension Annuity Contracts until such time as they shall have made provision therefor through a Municipal Employes' Retirement Fund, a Police Pension or Retirement Fund.

72 P.S. § 2263.2 (emphasis added). In its brief in support of its preliminary objections, Appellees assert that the purpose of changing to an Act 120 Plan was to enable the Borough to purchase annuities with a choice of payment options which would allow for survivor benefits. In order to accomplish this, on November 9, 1992, the Borough adopted Resolution 316A, which sets forth, in relevant part, that:
by virtue of Act 120 ... IT IS HEREBY ENACTED AND ORDAINED ...
...
SECTION 1. The Borough of Nanty Glo is hereby authorized to purchase on behalf of its two full time police officers Single Premium Deferred Annuity Contracts... to fund future retirement benefits under the Borough of Nanty Glo Police Pension Fund.
...
SECTION 4. No Police Officer who is currently a member of the Nanty Glo Police Pension Fund under Ordinance Number 417 who subsequently retires under Act 120 pursuant to this resolution shall have his pension rights diminished or reduced.
...
SECTION 19. This Resolution repeals all other Ordinances or Resolutions prior to the date of their enactment which Ordinances or Resolutions establish, maintain, govern, or regulate a Police Pension Plan of the Borough of Nanty Glo.
ENACTED into a Resolution of the Borough of Nanty Glo this 9th day of November 1992.
(Complaint, Exhibit B; R.R. at 18a-20a). Therefore, the Borough purchased annuities for Appellees in the amount of $309,918.12 for Brown and $233,797.98 for Fatula. In March of 1993, Fatula retired and, in January of 1994, Brown retired.
In its Complaint, the Borough further alleges that, on March 8, 1993, the Borough voted to dissolve Ordinance No. 417, which established the Pension Plan under Act 600 but that "the Minutes of the meeting and Borough records do not reflect the advertising of an Ordinance repealing the Plan." (Complaint, para. 17; R.R. at 6a). The Borough also alleges that "[a] review of the Borough's records reveals the existence of Ordinance No. 449, which purportedly was enacted on October 23, 1995. This Ordinance attempts to adopt a Pension Plan for the Borough police officers pursuant to Act 120." (Compliant, para. 18; R.R. at 7a). Ordinance No. 449 sets forth, in relevant part, that:
by virtue of Act 120. IT IS HEREBY ENACTED AND ORDAINED ...
...
SECTION 1. The Borough of Nanty Glo is hereby authorized to purchase on *61 behalf of its full-time police officers an Annuity Contract or Annuity Contracts to fund future retirement benefits under the Borough of Nanty Glo Police Pension Plan ...
...
SECTION 3. No police officer who was a member of the Borough of Nanty Glo Police Pension Plan or who has retired under Resolution No. 316A of the Borough of Nanty Glo Police Pension Plan or any officer who has retired prior to the adoption of this Ordinance or subsequently retires under Act 120 pursuant to this ordinance shall not have his pension rights diminished or reduced.
...
SECTION 5. The Normal Retirement Benefits shall be equal to the accrued benefits provided by the "Annual Premium Deferred Annuity" contract at the time an election to retire is made.
...
SECTION 16. This Ordinance repeals all other Ordinances or Resolutions prior to the date of their enactment which Ordinances or Resolutions establish, maintain, govern, or regulate a Police Pension Plan of the Borough of Nanty Glo.
ENACTED into an Ordinance of the Borough of Nanty Glo this 23rd day of October 1995.
(Complaint, Exhibit D; R.R. at 22a-25a). However, the Borough asserts that "[t]he minutes of an October 23, 1995 Borough Council Meeting do not reveal official action on Ordinance No. 449. In addition, the Borough's records reveal the failure to advertise the intent to enact Ordinance No. 449." (Complaint, para. 19; R.R. at 7a).
On February 19, 1999, the Borough transferred $238,507.88 from the initial Fatula Annuity and purchased a Single Premium Income Option Annuity. This "Second Fatula Annuity" provides death benefits to Fatula's spouse to be paid in a lump sum based on the Annuity fund value or in installments as may be elected by Fatula's spouse, who is the primary beneficiary. On February 23, 1999, the Borough also purchased a similar Annuity for Brown, the "Second Brown Annuity." (Complaint, paras. 20 and 21; R.R. at 7a). In their brief, Appellees assert that this modification occurred with both their consent and the consent of the Borough and was done for the purpose of changing the type of investment.
Based on the facts set forth above, the Borough further asserts in its Complaint that:
24. The monthly benefits paid to Brown and Fatula under the First Brown Annuity, Second Brown Annuity, the First Fatula Annuity and the Second Fatula Annuity (hereinafter collectively referred to as the "Annuities") are in excess of the benefits permitted under Act 600 and the Plan.
25. The amounts being paid to Defendants Brown and Fatula, in accordance with the Annuities and Resolution 316A, are unlawful for the following reasons:
(a) Resolution 316A has no legal effect as a Resolution may not repeal an Ordinance as a matter of law. Therefore, Ordinance No. 417 is still in effect, and the benefits being paid to Brown and Fatula are in excess of the amounts to be paid to them under Ordinance 417 and Act 600.
(b) The establishment of a Police Pension Plan when a Borough has less than three (3) full-time Police Officers must be enacted through an Ordinance pursuant to Section 1131 of the Borough Code, 53 P.S. § 46131. Therefore, Resolution 316A did not *62 lawfully create a Police Pension Plan, and Ordinance No. 417 remains in effect.
...
28. The Borough requests a determination from this Court that (a) Defendants Brown and Fatula are not entitled to the benefits provided under the Annuities issued to them, (b) Defendants Brown and Fatula's benefits must be limited in accordance with the Act 600, Ordinance 417 and the laws of the Commonwealth of Pennsylvania, and (c) Ordinance No. 449 is null and void as not having been properly adopted.
WHEREFORE, Plaintiff, the Borough of Nanty Glo, prays that this Honorable Court declare as follows:
(a) That [Appellees] are not entitled to the benefits provided under the annuities issued to them.
(b) That [Appellees] benefits must be limited to and be in accordance with Act 600, Ordinance 417 and the laws of the Commonwealth of Pennsylvania
(c) The Borough is authorized to surrender the Annuities at issue and utilize the funds to provide pension benefits to [Appellees] in accordance with Ordinance No. 417 and Act 600.
(d) That Ordinance No. 449 is null and void as not having been properly adopted.
(Complaint, pp. 5-6; R.R. at 8a-9a).
On August 30, 2002, Appellees filed Preliminary Objections to the Borough's Complaint for Declaratory Judgment. Appellees assert that the Complaint should be dismissed because it is legally insufficient and thus the Borough has failed to state a claim upon which relief may be granted because the Complaint seeks to diminish their pension benefits in derogation of the Section 1136 of The Borough Code,[3] which provides that:
No person participating in such police pension fund and becoming entitled to receive a benefit therefrom, shall be deprived of his right to an equal and proportionate share therein, upon the basis upon which he first became entitled thereto.
Appellees also filed preliminary objections asserting that: 1) the Borough failed to appeal the Ordinances at issue within 30 days and the Declaratory Judgment action is therefore time-barred,[4] 2) as a matter of law, the 1992 pension change was not required to comply with the provisions of Act 600 because there were only two members of the Nanty Glo police department at that time, 3) although Section 1131 of The Borough *63 Code, 53 P.S. § 46131, provides for the establishment of pension plans by ordinance, while the original 1992 change was made by resolution, the Borough adopted Ordinance No. 449 on October 23, 1995, which ratified that change and satisfies the requirement of the statute and 4) by failing to attach a copy of the annuities at issue, the Complaint is in violation of Pa. R.C.P. No. 1019(i), which provides that: "(i) When any claim or defense is based upon a writing, the pleader shall attach a copy of the writing, or the material part thereof ..."
In its brief in opposition to the preliminary objections of Appellees, the Borough argues that it is not attempting to seize the pension annuities of Appellees. Rather, the Borough, as a recipient of aid from the Commonwealth for its police pension fund and as a fiduciary under the pension plan, is charged with the responsibility of ensuring that beneficiaries under the plan, i.e. Appellees, are receiving appropriate benefits. The Borough wants the trial court to answer the following question: "Under what Ordinance, Plan or Resolution did Appellants retire that "entitled" them to pension benefits?" Therefore, the Borough filed a Declaratory Judgment action to have the trial court answer this question and determine that Appellees' benefits are limited to those provided in Act 600 because Ordinance No. 417, which established the Pension Plan, was never legally repealed. Here, the Borough asserts that Appellees are receiving benefits far in excess of those permitted by Act 600 and that, under the Plan and Ordinance No. 417, the pension benefits of Appellees would be limited to one-half their average salary during their last 60 months of employment.
On November 18, 2002, the trial court issued an opinion and stated that "[t]his Court finds as a matter of law that Plaintiff, Borough of Nanty Glo, is not entitled to change the pension rights granted to Defendants. Accordingly, there is no actual controversy and the action must be dismissed." (Trial court's opinion, p. 2.) Accordingly, the trial court sustained Appellees' preliminary objections and dismissed the Borough's Complaint. This appeal followed.[5]
On appeal, the Borough argues that it has stated a viable cause of action for declaratory judgment and that the trial court erred as a matter of law in determining that certain provisions of Act 600 and The Borough Code prohibit it from litigating whether the Appellees are entitled to receive their police pension retirement benefits in the amounts and form in which they are currently being paid.
In support of its decision, the trial court cited Police Officers of Borough of Hatboro v. Borough of Hatboro, 126 Pa. Cmwlth. 247, 559 A.2d 113 (1989), wherein this Court stated that:
It is well settled in Pennsylvania that public retirement benefits are viewed as deferred compensation. McKenna v. State Employees' Retirement Board, 495 Pa. 324, 433 A.2d 871 (1981); Wright v. Allegheny County Retirement Board, 390 Pa. 75, 134 A.2d 231 (1957). This fact confers upon public employees contractual rights protected by both the United States and Pennsylvania Constitutions. Catania v. State Employees' *64 Retirement Board, 498 Pa. 684, 450 A.2d 1342 (1982). These contractual pension rights become fixed upon the employee's entry into the system and cannot be subsequently diminished or adversely affected. Association of Pennsylvania State College and University Faculties v. State System of Higher Education, 505 Pa. 369, 479 A.2d 962 (1984); Catania. Both parties can, however, change the pension plan by mutual consent. Baker v. Retirement Board of Allegheny County, 374 Pa. 165, 97 A.2d 231 (1953).
Id. at 252, 559 A.2d 113 (emphasis added).
We agree with the trial court. No matter how the Borough presents its argument, it is basically trying to reduce the pension benefits of Appellees based on alleged procedural defects in the adoption of several Ordinances. However, "contractual pension rights become fixed upon the employee's entry into the [retirement] system and cannot be subsequently diminished or adversely affected." Borough of Hatboro. Therefore, the answer to the question "Under what Ordinance, Plan or Resolution did Appellants retire that "entitled" them to pension benefits?" is irrelevant because Appellees' pension benefits cannot be changed. Therefore, the trial court did not err by dismissing the Borough's Complaint.
Furthermore, we note that the trial court dismissed the Complaint solely on the basis that the Borough, as a matter of law, is not entitled to change the pension rights of Appellees. However, we agree with Appellees that the Complaint would also be barred by a thirty day statute of limitations even if the trial court had erred by dismissing the Complaint for this reason. We reach this conclusion because the basis for the Borough's argument that Appellees are not entitled to the pension benefits that they are receiving is that Ordinance No. 417, which established the Act 600 Plan, was never legally repealed and that Ordinance No. 449, which adopts an Act 120 Plan, was never adopted properly. However, pursuant to 42 Pa.C.S. § 5571(c)(5) "questions relating to an alleged defect in the process of enactment or adoption of any ordinance ... shall be raised by appeal or challenge commenced within 30 days after the intended effective date of the ordinance ..." (emphasis added). Thus, the Borough cannot now challenge the validity of the enactment of the Ordinances at issue in this case, as more than 30 days have passed since those ordinances were enacted. The Borough does correctly point out that it is improper to raise a statute of limitations defense in preliminary objections, which is how Appellees raised the statute of limitations issue in this case.[6] However, "[w]here a party erroneously asserts substantive defenses in preliminary objections rather than to [sic] raise these defenses by answer or in new matter, the failure of the opposing party to file preliminary objections to the defective preliminary objections, raising the erroneous defenses, waives the procedural defect and allows the trial court to rule on the preliminary objections." Preiser v. Rosenzweig, 418 Pa.Super. 341, 614 A.2d 303, 305 (1992). Here, the record shows that the Borough did not file preliminary objections to Appellees' *65 preliminary objections raising the fact that Appellees improperly raised the statute of limitations issue. Therefore, the Borough has waived this procedural defect and cannot raise it now.
Accordingly, the order of the trial court is affirmed.

ORDER
AND NOW, June 9, 2003, the order of the Court of Common Pleas of Cambria County docketed at No. 2002-2484 and dated November 18, 2002 is hereby AFFIRMED.
NOTES
[1]  Act of May 29, 1956, P.L. (1955) 1804, as amended, 53 P.S. §§ 767-778
[2]  An Act 120 Plan is authorized by Section 1.1 of the Act of May 12, 1943, P.L. 259, as amended, added by Section 2 of the Act of June 5, 1947.
[3]  Act of Feb. 1, 1966, P.L. (1965), 53 P.S. § 46136.
[4]  Appellees cite Section 1010 of The Borough Code, 53 P.S. § 46010 for this proposition. We note that Section 1010 was amended in 1978 by the Judiciary Act Repealer Act (JARA), Act of April 28, 1978, P.L. 202, which eliminated the 30 day limitation period from Section 1010 and added the 30 day requirement to Section 5571 of the Judicial Code, which provides, in relevant part, that "questions relating to an alleged defect in the process of enactment or adoption of any ordinance, resolution, map or similar action of a political subdivision, including appeals and challenges to the validity of land use ordinances adopted pursuant to the Pennsylvania Municipalities Planning Code, shall be raised by appeal or challenge commenced within 30 days after the intended effective date of the ordinance, resolution, map or similar action." 42 Pa.C.S. § 5571(c)(5). Thus, the Judicial Code, rather than The Borough Code, governs the applicable time period in which appeals challenging the process of enactment of ordinances or resolutions of a political subdivision, such as the Nanty Glo Borough Council in this case, may be taken. See Throop Borough Council v. Throop Property Owners Association, 709 A.2d 950, 953 (Pa.Cmwlth.1998).
[5]  Our scope of review of a trial court order sustaining preliminary objections on the basis that the law will not permit recovery (demurrer) is whether on the facts alleged the law states with certainty that no recovery is possible. Hawks by Hawks v. Livermore, 157 Pa. Cmwlth. 243, 629 A.2d 270 (1993). We must accept as true all well pled allegations and material facts averred in the complaint as well as inferences reasonably deductible therefrom and any doubt should be resolved in favor of overruling the demurrer. Id.
[6]  Pa. R.C.P. No. 1028 provides, in relevant part, that:

(a) Preliminary objections may be filed by any party to any pleading and are limited to the following grounds:
...
(4) legal insufficiency of a pleading (demurrer); and Note: The defense of the bar of a statute of frauds or statute of limitations can be asserted only in a responsive pleading as new matter under Rule 1030.
Pa. R.C.P. No. 1028(a)(4) (emphasis added).
