
145 Ill. App.3d 505 (1986)
495 N.E.2d 1100
LAKESIDE VILLAS HOMEOWNERS ASSOCIATION, INC., Plaintiff-Appellant,
v.
ZALE CONSTRUCTION COMPANY, INC., Defendant-Appellee and Third-Party Plaintiff (Samuel G. Footlik et al., Indiv. and d/b/a Footlik-Rose-Wengerhoff, Third-Party Defendants).
No. 84-2657.
Illinois Appellate Court  First District (2nd Division).
Opinion filed June 17, 1986.
*506 Michael D. Firsel and Alan D. Pearlman, both of Firsel & Salzman, Ltd., of Chicago, for appellant.
Stuart Smith and Jean Marie R. Pechette, both of Gordon & Glockson, P.C., of Chicago, for appellee.
Judgment affirmed.
PRESIDING JUSTICE BILANDIC delivered the opinion of the court:
Plaintiff, Likeside Villas Homeowners Association, Inc., filed a complaint at law against defendant Zale Construction Company, Inc., for negligence and breach of implied warranty of habitability. Thereafter, five amended complaints were filed. Each of these six complaints was stricken, dismissed or withdrawn. By February 22, 1984, this case had been pending for nearly seven years when plaintiff retained new counsel. On that date, original counsel was given leave to withdraw as attorney for plaintiff and to withdraw the fifth amended complaint. New counsel was given leave to enter an appearance and to file a sixth amended complaint within 28 days from February 22, 1984.
*507 The fourth amended complaint, filed by the original attorneys, attempted to state a cause of action on behalf of the plaintiff as "assignee" of various homeowners who purchased townhouses from defendant. On July 18, 1983, the trial court entered an order dismissing the fourth amended complaint and ordering that plaintiff be given 28 days in which to file an amended complaint "with respect to a cause of action based on powers of attorney or assignments." The fifth amended complaint was intended to cure this defect. It was withdrawn and is not part of the record.
Two months after the time specified in the court's order, new counsel asked leave to file the sixth amended complaint. It made no reference to a "cause of action based on powers of attorney or assignments." It attempted to bring in new parties plaintiff and to state a cause of action not based on "assignment." On July 17, 1984, a hearing was held on plaintiff's motion and defendant's objections to the motion.
New counsel explained that plaintiff's failure to include an allegation regarding the homeowners' assignment of rights to the Association was based on counsel's understanding that the order entered on February 22, 1984, did not place any restrictions on the proposed sixth amended complaint and, in effect, nullified the restrictions contained in the order of July 18, 1983. The trial court held that the February 22, 1984, order was a "deference given to [a] new attorney" to state a cause of action "in any way that he desires" without vitiating "any prior orders or restrictions." The court concluded that plaintiff, at this late date, was attempting to introduce new parties and to state a new cause of action. On July 17, 1984 (not to be confused with the July 18, 1983, order), the court denied plaintiff leave to file its sixth amended complaint and included in its order a finding that there was "no just reason to delay enforcement of, or appeal from, this order."
The plaintiff did not take any action regarding this order within the usual 30-day period. However, on August 16, 1984, plaintiff did act upon an order entered more than a year before by filing a "Motion to Vacate Order of July 18, 1983, and for Leave to File Sixth Amended Complaint." Defendant argued that the court lacked jurisdiction to vacate a 14-month-old order in view of its "final order of July 17, 1984." Counsel for plaintiff contends that at the July 17, 1984, hearing, the court invited him to move to vacate the then year-old order of July 18, 1983, if he desired to be free of the pleading restrictions imposed by that order and that he was merely responding to the court's suggestion. On September 26, 1984, an order *508 was entered denying plaintiff's motion to vacate the July 18, 1983, order, denying leave to file the sixth amended complaint, and dismissing the cause of action. Plaintiff filed a notice of appeal on October 24, 1984.
The issues presented are whether (1) this court has jurisdiction; and (2) the trial court erred in denying plaintiff leave to file its sixth amended complaint.

I
 1 The timely filing of a notice of appeal is jurisdictional. (Cronin v. Altman (1981), 101 Ill. App.3d 432, 434, 428 N.E.2d 586.) Defendant contends that plaintiff's notice of appeal was not filed until October 24, 1984, over 90 days after the entry of the final order on July 17, 1984, and therefore was not timely. Plaintiff responds that although it is true that the July 17, 1984, order stated that it was a "final and appealable order," the mere statement is not determinative of that issue. The test of finality of the order lies in the substance and not the form of the order. (Oak Brook Bank v. Citation Cycle Co. (1977), 45 Ill. App.3d 1053, 1057, 360 N.E.2d 458.) Thus, "the mere inclusion of a finding [of finality] in an order does not make the order final and appealable." In re Estate of Tingos (1979), 72 Ill. App.3d 703, 709, 391 N.E.2d 105.
 2 At the hearing giving rise to the July 17, 1984, order, the trial court suggested to plaintiff's counsel that the proper procedure to avoid the limiting effect of the July 18, 1983, order would be "to amend that order." Thus, the court was providing the plaintiff with a way to have the motion for leave to file the sixth amended complaint heard. "[I]f the court retains jurisdiction for future determination of matters of substantial controversy, the order is not final." (Mendelson v. Lillard (1980), 83 Ill. App.3d 1088, 1092, 404 N.E.2d 964.) Plaintiff followed the trial court's suggestion and moved to vacate the limiting order of July 18, 1983, and for leave to file its sixth amended complaint. The September 26, 1984, order denied plaintiff's motions and dismissed the cause of action. This was a final and appealable order and, therefore, plaintiff's notice of appeal was timely.

II
Plaintiff contends that the trial court erred in denying its motion to vacate the limiting order of July 18, 1983, and for leave to file the proposed sixth amended complaint.
In prior pleadings, plaintiff based its cause of action on an alleged *509 implied breach of warranty of habitability. The trial court noted that it dismissed these prior pleadings because plaintiff could not represent individual townhouse owners as to rights they had under prior existing contracts. Plaintiff did not come into existence until a date subsequent to defendant's sales of townhouses to the individual owners. Plaintiff did not choose to stand by its pleadings, but in another amendment attempted and failed to plead a valid theory of assignment or power of attorney. In order to give the plaintiff an opportunity to perfect either theory, the July 18, 1983, order limited the amendment to theories "based on powers of attorney or assignments."
 3 A plaintiff does not have an absolute and unlimited right to amend. (First Trust & Savings Bank v. Commonwealth Edison Co. (1986), 141 Ill. App.3d 668, 671.) The trial court acted within its discretion in limiting the proposed sixth amended complaint.
 4, 5 The decision of whether to allow or deny an amendment to a complaint rests within the sound discretion of the trial court, and its decision will not be disturbed on appeal absent an abuse of discretion. (Talas v. Youngstown Sheet & Tube Co. (1985), 134 Ill. App.3d 103, 107, 479 N.E.2d 1052.) The primary consideration involved here is that the trial court's decision furthers the ends of justice (Schenker v. Chicago Title & Trust Co. (1984), 128 Ill. App.3d 488, 491, 470 N.E.2d 1264, appeal denied (1985), 101 Ill.2d 593), and among the factors to consider is whether the proposed amendment would cure the defective pleading; whether it could cause prejudice or surprise to the other party; the timeliness of the proposed amendment; and whether previous opportunities to amend the pleadings occurred (Talas v. Youngstown Sheet & Tube Co. (1985), 134 Ill. App.3d 103, 107, 479 N.E.2d 1052).
 6 Up to July 18, 1983, plaintiff had five opportunities to state a cause of action. Instead of dismissing plaintiff's cause of action with prejudice, the trial court gave the plaintiff another opportunity but imposed the condition that the amended complaint must be "based on powers of attorney or assignments." The proposed sixth amended complaint is in direct violation of this limitation, since it was not "based on powers of attorney or assignments."
At the July 17, 1984, hearing, counsel for the plaintiff advised the court that he did not believe that the July 18, 1983, order limited the sixth amended complaint. The court advised counsel that it "allowed leave to file a sixth amended complaint only on the basis that it would be a complaint filed by new counsel with the restrictions of all prior orders of the court."
*510 It is obvious that counsel for the plaintiff was well aware of the fact that the final opportunity to state a cause of action would be based upon the limitations of the July 18, 1983, order. Instead of complying with the limitations, plaintiff's sixth amended complaint defiantly attempted to bring a new lawsuit, with new parties, and a new cause of action.
The validity of any prior pleadings is not involved in this appeal because the filing of an amended complaint is a waiver of the right to attack the dismissal of earlier complaints. Henkhaus v. Barton (1977), 56 Ill. App.3d 767, 769, 371 N.E.2d 1166, appeal denied (1978), 71 Ill.2d 603.
 7 The trial court has broad discretion in deciding whether or not to permit amendment of pleadings. (Mundt v. Ragnar Benson, Inc. (1975), 61 Ill.2d 151, 161, 335 N.E.2d 10.) In Montgomery Ward & Co. v. Wetzel (1981), 98 Ill. App.3d 243, 250, 423 N.E.2d 1170, the court stated: "Although the policy adopted by Illinois courts is one of liberality in allowing amendments, the parties do not have an absolute or unlimited right to amend."
 8 Although the trial court should be liberal in allowing proper amendments to a complaint, the court is not required to repeatedly permit a party to file pleadings which do not cure defects upon which the court ruled. Alster v. Chicago Tastee-Freez Corp. (1966), 76 Ill. App.2d 388, 222 N.E.2d 274.
We conclude that the trial court correctly refused to vacate the limiting order and properly denied leave to file the sixth amended complaint. Accordingly, the judgment of the circuit court of Cook County is affirmed.
Affirmed.
STAMOS and HARTMAN, JJ., concur.
