OPINION OF THE COURT
Joseph Goldstein, J.Is a landlord bound to retain a month-to-month tenant when that tenant has complained to some official body regarding a housing code violation, or may the landlord seek to terminate such a tenancy without being violative of section 223-b of the Real Property Law? May actions by the tenant or her representatives waive the statutory protection of “retaliatory eviction”?
These questions would appear to be ones of first impression.
I — THE FACTS
The tenant in this proceeding is a female head of the household with nine children who resides in the landlord’s premises pursuant to a month-to-month tenancy. Shortly after the tenant complained to an official body (March 9, *5191981 to the Village of Freeport), the landlord gave tenant written notice of termination of tenancy, and subsequently commenced a summary proceeding for possession of the subject premises.
Upon the first appearance before the court (May 11, 1981), the tenant together with her social worker apparently discussed this matter with the Judge presiding and then with the landlord’s attorney and stipulated regarding a disposition. A final order was entered and it was agreed that the tenant would have until June 30, 1981 to vacate the premises. This seven-week stay was given in order to permit the tenant’s children to complete the school year and provide the tenant with sufficient time to locate another residence. A certain payment schedule was provided as part of that stipulation.
Apparently an alleged default therein occurred and the landlord accelerated eviction proceedings. Shortly thereafter the first order to show cause in this proceeding was submitted by tenant’s present counsel, the Nassau Suffolk Law Services Committee, Inc. The relief sought by counsel was for an “Order staying the execution of the Warrant of Eviction to and including June 30, 1981.”
At that time counsel was aware of all the defenses which she now raises and this may clearly be noted from the affidavit in support of the order to show cause subscribed to by the tenant dated June 12, 1981.
Upon the return date (June 22, 1981), there was an agreement between counsel, and the court file reflects “Settled — Final Judgment stayed consent 6/30 — Tenant paid $80 in Court — Consent.”
This court has now been presented with a second order to show cause which raises for the first time the spectre of “retaliatory eviction”. Tenant’s counsel seeks to utilize this defense for the purposes of staying the eviction and for an “order *** vacating the judgment entered herein and setting the matter for trial”.
II
Section 223-b of the Real Property Law is one of a group of statutes whose provisions limit the rights of *520parties with respect to their freedom to contract. If the defense of “retaliatory eviction” is successfully asserted, the contractual relationship between a landlord and his tenant will be modified pursuant to section 223-b (subd 5, par [c]) of the Real Property Law, which provides that a landlord may not serve notice to quit; institute an action or proceeding to recover possession; or substantially alter the terms of the tenancy within six months of a finding that the landlord has sought to recover possession in retaliation for actions taken by the tenant as set forth in the statute. The six months’ provision of section 223-b has its greatest impact on a month-to-month tenancy. If the defense of “retaliatory eviction” is sustained, it would appear that the landlord may be required to allow the tenant to remain in possession for an additional six months, if the tenant so desires.
May section 223-b of the Real Property Law modify the oral lease between a landlord and his month-to-month tenant by compelling the landlord to continue the landlord-tenant relationship for an additional six months? As guidance, the court must consider an interpretation given to the provisions of section 226-b of the Real Property Law, “Right to sublease or assign”, by the Court of Appeals, wherein it stated that the law has made “substantial inroads” into the freedom of private contracts, thereby relieving the tensions that arise between the freedom to contract, a concept that is inherent to our socioeconomic system, and the belief that the members of an “enlightened society” must be protected from the potentially harsh effects of an unchecked free market system (Rowe v Great Atlantic & Pacific Tea Co., 46 NY2d 62).
In the area of landlord and tenant relationships examples of statutory intervention in the freedom to contract mandate the inclusion of certain substantive or procedural protections in residential lease agreements. In addition to section 226-b of the Real Property Law, section 235-b of the Real Property Law limits the freedom to contract by prohibiting the waiver (emphasis supplied) or modifications of lease provisions affecting the habitability of certain resi*521dential premises. Section 223-b, which has been raised in the present case, modifies the contractual relationship between a landlord and a tenant by compelling a landlord to refrain from seeking to recover possession under certain circumstances when it has been found that the landlord had served a notice to quit; instituted an action or proceeding to recover possession; or substantially altered the terms of the contract in retaliation for actions of the tenant as enumerated by the statute.
Section 223-b aims to encourage tenants to come forward and report housing code violations without fear of reprisal and seeks to protect the tenant who has reported a housing code violation from the potential for injustice inherent in a relationship in which a landlord might capriciously or vindictively evict a tenant. Without the protection from eviction as provided for by section 223-b of the Real Property Law, the threat of eviction would have the tendency to stifle justifiable complaints and the legislative intention to provide safe and decent housing to the residents of New York State, as reflected in section 235-b of the Real Property Law (warranty of habitability) would be frustrated. (See, also, Markese v Cooper, 70 Misc 2d 478.) Therefore, to the extent that section 223-b of the Real Property Law “Retaliation by landlord against tenant”, modifies the contractual relationship between landlord and tenant by compelling a landlord to retain a tenant whom he has tried to evict in retaliation for that tenant having reported a code violation in good faith, the statute does encroach upon the right of freedom to contract. Such limitation on the freedom to contract has been determined by the Legislature as necessary to encourage the enforcement of the housing codes.
Ill
WAIVER OF AFFIRMATIVE DEFENSE OF “RETALIATORY EVICTION”
The Legislature has clearly enunciated the public policy of this State that a tenant may not waive, by way of lease provision, the protection of the implied warranty of fitness of the premises for human habitation.
*522The Governor, in his message of approval accompanying the law, stresses the importance of the warranty of habitability by stating: “By one large step this bill moves the law of landlord and tenant into the twentieth century.” (NY Legis Ann, 1975, p 438.)
Likewise the courts have held a waiver of the warranty of habitability in a lease to be void. (Cosmopolitan Assoc. v Ortega, 90 Misc 2d 437.)
However, no language prohibiting “waiver” as found in section 235-b of the Real Property Law can be located in section 223-b of the Real Property Law, nor in the Governor’s message of approval (July 13, 1979, NY Legis Ann, 1979, p 421).
It is not for a trial court to act in a legislative manner and insert language in a statute which the Legislature or the Governor might well have considered had they deemed same appropriate. Apparently it was their intention to leave that option to the parties and their counsel.
Subdivision (4) of section 223-b of the Real Property Law states in part that “Retaliation shall be asserted as an affirmative defense in such action or proceeding.” It is a general rule of law that an affirmative defense is waived if not raised in an answer or by motion (see De Lisa v Amica Mut. Ins. Co., 59 AD2d 380; 125 Skillman Ave. Corp. v American Home Assur. Co., 103 Misc 2d 284).
In the case at bar, this affirmative defense was not raised by the tenant on the first occasion at the hearing, nor and more importantly, did counsel for the tenant raise this defense on the second appearance (the first order to show cause) before this court. Upon a reading of the affidavits prepared by counsel in support of the first order to show cause, counsel clearly knew of the potential affirmative defense but for reasons known best to counsel, he chose not to raise the affirmative defense at that time. Instead, counsel chose to seek an order staying the execution of the previously granted warrant of eviction to and including June 30,1981, the same date as previously consented to by *523the tenant and the landlord. In counsel’s affidavit in support of the first order to show cause, there is not even the scent of a request to set aside the prior order of this court nor is there any request to open the prior proceedings in order to permit the tenant to assert her alleged affirmative defense of “retaliatory eviction”. The tenant by counsel appeared on the return date of the order to show cause and consented to the entry of an order restoring the stay of the issuance of the warrant to the original date of June 30, 1981. The facts in this case are crucial to the consideration of the tenant’s second order to show cause and dictate the appropriate remedy which must flow therefrom.
In this case, a contractual waiver is not before the court. This is a knowing waiver of an affirmative defense by the tenant, together with counsel, and would not be prohibited by any reasonable interpretation of section 235-b or section 223-b of the Real Property Law.
In effect counsel is now seeking a “third bite at the apple” and such should not be encouraged. There must be some finality to the legal process, notwithstanding the distaste one has for its effect.
While the tenant is indeed a person in need, being a female head of the household, having in residence her nine minor children, and being a recipient of public assistance, there is a biblical admonition, long since adopted by our law which enunciates the principle that “Thou shalt not wrest Judgment *** nor * * * show partiality between persons * * * Justice shalt thou follow.” (Deuteronomy XVI.) And yet “Justice” must be tempered when good cause has been demonstrated.
IV — CONCLUSION
The tenant has already, by making this application, sought and obtained substantial delay in the eviction proceedings. It is therefore the decision of this court that the application of the tenant sought in the order to show cause *524is denied and the stay of the order of eviction previously granted shall be terminated as of August, 1981.