
289 N.J. Super. 549 (1996)
674 A.2d 612
WILLIAM MUSSELMAN AND CHANDRA RAMU, PLAINTIFFS-RESPONDENTS,
v.
KAREN CARROLL, DEFENDANT/COUNTERCLAIMANT-APPELLANT.
Superior Court of New Jersey, Appellate Division.
Argued March 19, 1996.
Decided April 12, 1996.
*551 Before Judges BAIME and VILLANUEVA.
Michael P. Hickey argued the cause for appellant.
Respondents William Musselman and Chandra Ramu argued the cause pro se.
The opinion of the court was delivered by VILLANUEVA, J.A.D. (retired and temporarily assigned on recall).
Defendant Karen Carroll appeals from the trial court's order dismissing her counterclaim for lost rent and ordering defendant to return plaintiffs' security deposit, minus certain charges for damages to the premises and a late fee.[1] We reverse and remand for entry of judgment on the counterclaim in favor of defendant/counterclaimant.
Defendant is the owner of a single-family house located at 214 Larch Avenue, Teaneck, New Jersey. On or about August 29, 1994, defendant entered into a written lease of the premises with plaintiffs Chandra Ramu and William Musselman. While negotiating to rent defendant's house, plaintiffs advised defendant that they wished to have a month-to-month lease since they were hoping to buy a residence. In light of the fact that the plaintiffs might terminate the lease in a short period of time, defendant required a sixty-day notice-to-vacate provision so that she would have sufficient time to re-rent the premises. The signed lease provided that the term would be month-to-month and would begin *552 on September 1, 1994, but plaintiffs agreed to provide defendant with sixty-days' notice of their intention to vacate. In addition, plaintiffs provided a security deposit equal to one and one-half months' rent.
Approximately two months after moving into the house, on or about November 15, 1994, plaintiffs sent a letter to defendant, stating they intended to move out on January 15, 1995. As a result of plaintiffs' notice, defendant sought to rent the house to Pam Aspen. Aspen allegedly agreed to rent the house so long as it would be available on January 15, 1995. As a result of this oral agreement, defendant sent a letter to plaintiffs on December 29, 1994. For some inexplicable reason, the trial court refused to consider this letter which confirmed plaintiffs' move-out date of January 15, 1995, and also advised plaintiffs that since defendant had re-rented the house as a result of their notice to vacate, defendant expected plaintiffs to move out by January 15, 1995.
In response, plaintiffs sent defendant a letter dated January 1, 1995, advising her that they would not vacate the house on January 15, 1995, as originally stated but that they intended to remain in the house until the end of January. Defendant contacted Aspen, who advised defendant that she already had given notice to her landlord that she would be leaving and that she had to either move into defendant's house by January 15 or find someplace else to live. Defendant sent another letter to plaintiffs advising them that she had re-rented the house and that they would be required to vacate the premises by January 15, 1995.
The uncertainty of the situation led Aspen to speak directly with the plaintiffs about their plans. Shortly after Aspen met with plaintiffs, she advised defendant that she would be unable to sign a lease because defendant could not assure her that the plaintiffs would move out by the fifteenth. Due to plaintiffs' unilateral extension of their move-out date, defendant lost Aspen as a tenant.
Defendant accepted the plaintiffs' payment of rent for the remainder of January, expecting plaintiffs to vacate by the end of that month. However, on February 4, 1995, plaintiffs sent defendant *553 a letter with a rent check for the first two weeks of February, stating that they had no idea when they were going to move. Plaintiffs also advised defendant that she should not rent the premises without first checking with them. At that point, since defendant had no idea when the house would become available, she obviously was unable to re-rent the house.
On February 14, 1995, defendant, upset by plaintiffs' refusal to pay February's rent in full and afraid plaintiffs might not pay rent even for the remainder of February, sent plaintiffs a letter advising them that the remaining rent for February was due immediately and that she would file a notice of eviction if she did not receive the February rent by February 15, 1995. Despite the fact that plaintiffs clearly owed the remaining rent for February, they did not pay it but, instead, had their attorney send a letter to defendant's attorney asking to discuss the matter further. The trial court inexplicably refused to consider these two letters.
On February 16, 1995, when defendant still had not received the rent, she discussed filing a dispossess claim with a clerk in the Superior Court, Special Civil Part, who told her to file a complaint for possession indicating that she was seeking one and one-half months' rent, possession of the premises and costs. Defendant did so on that same day. We note that defendant did not have the advice of counsel at the time and claims to have not known the difference between an action for rent and an action for possession.
Plaintiffs sent defendant a letter dated February 16, 1995, which purported to enclose a check for the rent for the remainder of February and stated that they intended to "vacate the house at the end of February." The rent payment was not enclosed with the letter but came with a different letter a few days later in which plaintiffs indicated their intention to move out by the end of February. Plaintiffs' attorney then advised defendant by letter that plaintiffs expected to receive their entire security deposit back. Again, the trial court inexplicably failed to consider these letters.
*554 In light of plaintiffs' prior practices, defendant had no reason to believe plaintiffs would actually move out by the end of February. Plaintiffs ultimately vacated the premises on February 24, 1995. However, defendant was not able to secure a new tenant until April 12, 1995, for a move-in date of May 1, 1995. Since defendant lost two months rent, she retained plaintiffs' security deposit.
On or about May 4, 1995, plaintiffs filed this action against defendant for the return of their security deposit and for various other alleged damages. Defendant filed an answer and counterclaim for damages, claiming lost rent due to plaintiffs' failure to provide the required sixty-day notice of their intention to vacate, a late charge, and damage to the premises.
The trial court ordered defendant to return plaintiffs' security deposit, minus certain charges for damages to the premises and a late fee. The trial court dismissed the plaintiffs' other claims for damages and dismissed defendant's counterclaim for lost rent. The trial court allowed defendant $75 for the damage to the bathroom and $35 for the late fee, resulting in a judgment for a net amount of $2,125 (security deposit of $2,235 less $110). The trial court told defendant, "You're going to pay the money or [sic] you want me to put a judgment in." The trial court based its opinion on its belief that the filing of the complaint for possession terminated the tenancy and, thereafter, defendant "voluntarily accepted the two weeks rent."

I.
On appeal, defendant argues that the trial court erred in dismissing defendant's counterclaim for the loss of two months' rent due to plaintiffs' failure to provide sixty-days' notice of their intent to vacate. We agree.
Simply stated, the trial court failed to enforce the lease as written. Parties may enter a lease which provides for a period of notice to vacate different from statutory notice provisions, and the parties will be bound to such terms. See Pennsylvania R.R. v. L. *555 Albert & Son, Inc., 26 N.J. Super. 508, 513, 98 A.2d 323 (App.Div. 1953), certif. denied, 13 N.J. 361, 99 A.2d 675 (1953) ("`[W]here, as here, the parties agree on the number of days to be given to terminate the tenancy there is no violence to public policy if such an agreement be enforced.'") (citation omitted).
Further, the trial court's ruling ignored the essential purpose of a notice provision in a lease  to provide the landlord with "a reasonable opportunity to secure another tenant." S.D.G. v. Inventory Control Co., 178 N.J. Super. 411, 415, 429 A.2d 394 (App. Div. 1981); see also Harry's Village, Inc. v. Egg Harbor Tp., 89 N.J. 576, 584, 446 A.2d 862 (1982). Although plaintiffs repeatedly changed their move-out date and remained unable or unwilling to provide any commitment as to when they would vacate, the trial court relieved plaintiffs of their obligations under the lease and even denied defendant the right to the minimum one month's notice to quit provided by the common law rule. See S.D.G. v. Inventory Control Co., supra, 178 N.J. Super. at 414-15, 429 A.2d 394.

II.
Defendant argues that the trial court erred in holding that defendant's filing of an action for rent and possession terminated both the lease and plaintiffs' obligation to provide defendant with notice of the date they would vacate the premises. We agree with defendant.
Contrary to the trial court's holding, it is a judgment of possession, and not the filing of a complaint for possession, which will terminate a tenancy. An action for possession will be dismissed if the tenant pays the amount of rent owed before a judgment is entered. Stanger v. Ridgeway, 171 N.J. Super. 466, 473, 410 A.2d 59 (App.Div. 1979); see also Vineland Shopping Ctr., Inc. v. DeMarco, 35 N.J. 459, 465, 173 A.2d 270 (1961). Thus, the *556 effect of a tenant's payment of rent[2] before a judgment is entered, as was done herein, is to dismiss the complaint and continue the tenancy at issue. See N.J.S.A. 2A:18-55. Once defendant received the rent, the trial court's jurisdiction to terminate the tenancy ended; if defendant wanted to continue to dispossess plaintiffs, she could not do so without filing a new complaint based upon new grounds. See Vineland Shopping Ctr., Inc. v. DeMarco, supra, 35 N.J. at 465, 173 A.2d 270 (Upon payment of past-due rent, "the court's jurisdiction ends.").
Defendant's acceptance of the rent was not a waiver of her rights under the lease, particularly since she objected to the plaintiffs' extension of their stay and notified them they would be responsible for the damages.[3]See Montgomery Gateway East I v. Herrera, 261 N.J. Super. 235, 240, 618 A.2d 865 (App.Div. 1992). To rule otherwise would punish defendant for accepting rent which she was entitled to receive under the lease. Moreover, to compel her to reject the rent would be inequitable in that it would require her to forego rent she was entitled to receive by law  rent she possibly would be unable to collect in a subsequent action for money damages  solely because the plaintiffs breached their agreement.
We reverse and remand to the trial court to enter judgment on the counterclaim for March and April rent, $35 for a late charge and $75 for shower damage, plus interest on the total damages, less the security deposit with accrued interest thereon.
NOTES
[1]  The order also dismisses plaintiffs' contract and tort claims from which there was no cross-appeal.
[2]  The balance of the February rent was paid in late February, before the March 9 return date of the dispossess action. The complaint was therefore withdrawn.
[3]  Actually, plaintiffs could have been charged double rent for the period after January 15, 1995, that possession was withheld. See N.J.S.A. 2A:42-5 & 6.
