
395 Pa. Superior Ct. 221 (1990)
576 A.2d 1123
Madeleine P. MacGREGOR, Appellant,
v.
MEDIQ INC. and Kenneth Parker Associates, Inc. and Allstate Insurance Company.
Supreme Court of Pennsylvania.
Argued May 3, 1990.
Decided June 27, 1990.
*223 Robert Gosner, Philadelphia, for appellee.
Nicholas Poduslenko, Philadelphia, for appellant.
Before DEL SOLE, JOHNSON and HOFFMAN, JJ.
HOFFMAN, Judge:
This appeal is from an order dated June 30, 1989, granting appellee Kenneth Parker Associates' (KPA) preliminary objections in the nature of a demurrer to count II of appellant's complaint. Appellant contends that the trial court erred in (1) dismissing the count, without leave to amend, on the technical basis that several causes of action had been pleaded under one count in violation of Pa.R.Civ.P. 1020(d)(1); (2) finding that the complaint did not set forth sufficient facts to justify recovery for either punitive damages or emotional distress; and (3) raising, sua sponte, a defense which served as an alternate basis for dismissing the entire cause of action against KPA. For the reasons set forth below, we agree with appellant that the trial court erred in granting KPA's preliminary objections and, accordingly, we reverse the order below and remand for proceedings consistent with this opinion.
Beginning in January of 1985, appellant was employed at KPA as a staff designer. On February 16, 1986, appellant enrolled both herself and her husband under an insurance policy written by defendant Allstate Insurance Company (Allstate), and made available to her by defendants Mediq Inc. (Mediq) and KPA. This action arose when the defendants *224 refused to pay life insurance proceeds upon appellant's husband's death.
On February 7, 1989, appellant filed a complaint in three counts against KPA, Mediq, and Allstate, alleging breach of contract, negligence, estoppel, and fraud. The counts of the complaint were very similar except for the identity of the named defendant: count I was against Mediq, count II was against KPA, and count III was against Allstate. On March 29, 1989, Mediq and KPA filed preliminary objections requesting that counts I and II of appellant's complaint be dismissed.[1] In seeking dismissal, KPA and Mediq alleged that appellant violated Pa.R.Civ.P. 1020(d)(1) because she had failed to set forth her causes of action for trespass, contract, estoppel and fraud in separate counts.[2] Further, they alleged that appellant had failed to aver facts sufficient to support a claim for punitive damages and emotional distress in a contract action. In her response to the preliminary objections, appellant asserted that her complaint was not in violation of Rule 1020(d)(1) and should not be dismissed. In the alternative, she maintained that if the trial court did find that she had failed to comply with Rule 1020(d)(1), it should grant her request for leave to amend her complaint. In addition, appellant attached her proposed amended complaint to her response. On June 30, 1989, the trial court issued an order sustaining KPA's preliminary objections, and completely striking count II of the complaint, thereby dismissing KPA from the case. The trial court, however, overruled the same preliminary objections made as to count I against Mediq and ordered it to file an answer within thirty days. On August 18, 1989, appellant *225 filed an appeal from the trial court's June 30, 1989 order,[3] and on December 11, 1989, the trial court issued its opinion. In that opinion, the trial court reasoned that a demurrer to count II was sustainable because (a) count II was improperly pleaded in that it presented several causes of action under one count, (b) to the extent appellant sought punitive and emotional distress damages, the count was defective in that it did not set forth distinct claims for negligence and fraud, and (c) KPA was immune from liability, in that it hired Mediq as an independent contractor for the purposes of administering the insurance plan. Moreover, the trial court went on to state that Mediq's preliminary objections to count I had been inadvertently overruled.[4] Finally, the trial court noted that, had appellant filed a motion for reconsideration, leave to amend would have been granted in order to file a single cause of action for breach of contract against KPA. See Trial Court Opinion at 1-3.
Our scope of review in considering a challenge to a trial court's decision granting preliminary objections in the nature of a demurrer is well-settled:
A demurrer can only be sustained where the complaint is clearly insufficient to establish the pleader's right to relief. Firing v. Kephart, 466 Pa. 560, 353 A.2d 833 (1976). For the purpose of testing the legal sufficiency of the challenged pleading a preliminary objection in the nature of a demurrer admits as true all well-pleaded, material, relevant facts, Savitz v. Weinstein, 395 Pa. 173, 149 A.2d 110 (1959); March v. Banus, 395 Pa. 629, 151 A.2d 612 (1959), and every inference fairly deducible from *226 those facts, Hoffman v. Misericordia Hospital of Philadelphia, 439 Pa. 501, 267 A.2d 867 (1970); Troop v. Franklin Savings Trust, 291 Pa. 18, 139 A. 492 (1927). The pleader's conclusions or averments of law are not considered to be admitted as true by a demurrer. Savitz v. Weinstein, supra.

Since the sustaining of a demurrer results in a denial of the pleader's claim or a dismissal of his suit, a preliminary objection in the nature of a demurrer should be sustained only in cases that clearly and without doubt fail to state a claim for which relief may be granted. Schott v. Westinghouse Electric Corp., 436 Pa. 279, 259 A.2d 443 (1969); Botwinick v. Credit Exchange, Inc., 419 Pa. 65, 213 A.2d 349 (1965); Savitz v. Weinstein, supra; London v. Kingsley, 368 Pa. 109, 81 A.2d 870 (1951); Waldman v. Shoemaker, 367 Pa. 587, 80 A.2d 776 (1951). If the facts as pleaded state a claim for which relief may be granted under any theory of law then there is sufficient doubt to require the preliminary objection in the nature of a demurrer to be rejected. Packler v. State Employment Retirement Board, 470 Pa. 368, 371, 368 A.2d 673, 675 (1977); see also Schott v. Westinghouse Electric Corp., supra [436 Pa.] at 291, 259 A.2d at 449.
County of Allegheny v. Commonwealth, 507 Pa. 360, 372, 490 A.2d 402, 408 (1985); see also Mudd v. Hoffman Homes for Youth, Inc., 374 Pa.Super. 522, 524-25, 543 A.2d 1092, 1093-94 (1988). With this standard in mind, we turn to appellant's contentions.
First, appellant contends that the trial court erred in dismissing, without leave to amend, count II of her complaint on the basis that several causes of action were pleaded under one count in violation of Pa.R.Civ.P. 1020(d)(1). Appellant does not dispute that she violated this rule by raising several causes of action in one count. However, she argues that the violation was merely technical in nature and did not warrant a dismissal of the entire cause of action against KPA. Instead, appellant argues that the *227 proper course was to grant her leave to amend her complaint pursuant to Pa.R.Civ.P. 1033.
Rule 1033 provides in relevant part that:
A party, either by filed consent of the adverse party or by leave of court, may at any time change the form of action, correct the name of a party or amend his [or her] pleading.
Pa.R.Civ.P. 1033. It has long been the law in this Commonwealth to liberally grant leave to parties to amend their pleadings. Biglan v. Biglan, 330 Pa.Super. 512, 521, 479 A.2d 1021, 1025 (1984). Although the decision of whether to grant leave to amend a pleading is a matter of judicial discretion, such amendments should be allowed at any stage of the proceedings to secure a decision on the merits, unless they violate the law or unfairly prejudice the rights of the other party. Soxman v. Goodge, 372 Pa.Super. 343, 347, 539 A.2d 826, 828 (1988). Thus, if no prejudice results, pleadings may be amended "after pleadings are closed, while a motion for judgment on the pleadings is pending, at trial, after judgment, or after an award has been made and an appeal taken therefrom." Biglan v. Biglan, 330 Pa.Super. 512, 521, 479 A.2d 1021, 1025-26 (1984) (citations omitted). "The fundamental purpose of this rule is to prevent cases from turning on purely technical defects." Id., 330 Pa.Superior Ct. at 521, 479 A.2d at 1026. Moreover, prejudice, in turn, must be more than a mere detriment to the other party because any amendment requested certainly will be designed to strengthen the legal position of the amending party and correspondingly weaken the position of the adverse party. Carpitella by Carpitella v. Consolidated Rail Corp., 368 Pa. 153, 157, 533 A.2d 762, 764 (1987).
Here, we find that to the extent the trial court granted KPA's preliminary objections and refused to allow appellant to amend her complaint based on the Rule 1020 defect, it abused its discretion. Appellant's failure to set out each cause of action against KPA in a separate count is clearly a technical error, which in no respect affects the substance of the pleading. See Commonwealth ex rel. Specter v. *228 Bauer, 437 Pa. 37, 40 n. 2, 261 A.2d 573, 574 n. 2 (1970) (no reason to dismiss complaint where captioning incorrect, as such defect is easily correctable by amendment); Mancine v. Concord-Liberty Sav. & Loan Ass'n, 299 Pa.Super. 260, 269-70, 445 A.2d 744, 749 (1982) (right to amend should be liberally granted and fact that plaintiff erroneously labeled action as assumpsit of no importance). Moreover, appellees are unable to show how they have been or will be prejudiced by appellant's request to amend her complaint. See Carpitella by Carpitella v. Consolidated Rail Corp., supra; Tanner v. Allstate Ins. Co., 321 Pa.Super. 132, 137, 467 A.2d 1164, 1167 (1983). In this case, appellant simply sought to amend her complaint so as to reorganize the pleadings into separate counts. Such an amendment clearly would remedy the defect, would help to focus the issues and ensure that the case is not decided on a technical error. In light of the fact that the technical error could easily have been corrected by amendment, see R.P. Clarke Personnel v. Commonwealth Nat'l Bank, 384 Pa.Super. 524, 535, 559 A.2d 560, 566 (1989), and because a demurrer is proper only "in cases that clearly and without doubt fail to state a claim for which relief may be granted," see County of Allegheny v. Commonwealth, supra, we hold that the trial court abused its discretion in sustaining the demurrer and refusing to grant appellant such leave to amend her complaint.[5] We find further support for our conclusion by noting that a contrary holding would require a disingenuous reading of Rule 1020. The primary purpose of Rule *229 1020(d)(1) is to ensure that causes of actions arising out of the same transaction or occurrence are tried together in the same suit. In fact, if a plaintiff fails to properly plead all such causes of action, the cause not pleaded is waived. See Pa.R.Civ.P. 1020(d)(1), Historical Note. Incidental to this principal purpose, is the requirement that these causes of action should be set out in different counts. Appellee would have us latch on to this rule, which primarily relates to mandatory joinder, and hold that it mandates the extreme sanction of dismissal for a mere failure to list the separate causes of action under separate counts. This we refuse to do.
Appellant also takes issue with the court's ruling on her claim for emotional distress and punitive damages.[6] Appellant maintains that the trial court based this decision on a misunderstanding of the causes of action and the corresponding damages requested in the original complaint. Appellant suggests that the court erroneously believed that because the various causes of action were brought within the same count, the negligence and fraud claims were merely alternative theories of liability based on the underlying breach of contract cause, and not separate causes of action. This misunderstanding, in turn, led to the court's conclusion that appellant failed to set forth a claim for punitive damages or emotional distress.
A review of appellant's original complaint reveals that although all three claims (negligence, fraud, and breach of contract) are contained in one count, the facts as set forth in the complaint establish the essential elements of each cause of action. Moreover, appellant's claims for negligence and fraud are set out in separate paragraphs and are distinguishable from her claim for breach of contract. Appellant's prayer for relief in the form of punitive and emotional distress damages are not requested until after her claims for negligence and fraud. These types of damages, of course, are recoverable under these two theories of *230 liability. See Restatement (Second) of Contracts, § 355, at 154 (1981) (punitive damages are not recoverable in action for breach of contract but are recoverable in tort action brought in conjunction with action for breach of contract); Restatement (Second) of Torts, § 908 comment b, at 464 (1977) (same). Thus, in admitting as true all well-pleaded material facts, and every inference deducible from those facts, we find that count II set forth facts sufficient to state a claim for relief under negligence and fraud as well as breach of contract, and thus, appellant should be afforded the opportunity to request punitive and emotional distress damages.
Appellant finally contends that the trial court erred by raising, sua sponte, a defense which served as an alternative basis for dismissing the entire cause of action against KPA. Appellant notes that the trial court, sua sponte, found that KPA, as appellant's employer, was immune from liability because it had hired Mediq, an independent contractor, for purposes of implementing the insurance policy in question. Appellant maintains that it was a clear error for the court to raise this supposed immunity defense, sua sponte, as a basis for dismissing the entire cause of action against KPA.[7] We agree.
It is inappropriate, of course, for a trial court to act as an advocate and raise a defense on behalf of a party. See Wojciechowski v. Murray, 345 Pa.Super. 138, 142, 497 A.2d 1342, 1344 (1985) (trial court had no authority to sua sponte employ Political Subdivision Tort Claims Act as basis for dismissing claim against defendant who had not raised defense); see also Travers v. Cameron County School District, 117 Pa.Commw. 606, 544 A.2d 547 (1988); Gubernick v. City of Philadelphia, 85 Pa.Commw. 397, 481 *231 A.2d 1255 (1984). In this case, a review of the preliminary objections raised by KPA reveal no reference to a defense based on the theory that KPA hired Mediq as an "independent contractor." Instead, as we noted above, the preliminary objections raised only the questions regarding the Rule 1020 defect and whether the averred facts supported a claim for emotional distress and punitive damages. Under the Rules and the case law, it is clear that matters not raised in preliminary objections may not be considered by the court sua sponte. See Pa.R.Civ.P. 1032; Wojciechowski v. Murray, supra. Accordingly, because the defense was not raised by appellee, the court's granting of preliminary objections is not sustainable on this ground.
For the foregoing reasons, we reverse the order below and remand for proceedings consistent with this opinion.
Order reversed and case remanded. Jurisdiction relinquished.
NOTES
[1]  Allstate did not file preliminary objections; accordingly, it is not a party to this appeal.
[2]  Pa.R.Civ.P. 1020(d)(1) provides that:

If a transaction or occurrence gives rise to more than one cause of action against the same person, including causes of action in the alternative, they shall be joined in separate counts in the action against any such person.
Id.
[3]  The June 30, 1989 order was not entered on the docket until July 20, 1989. Thus, appellant's appeal was timely filed. Moreover, the trial court's refusal to grant appellant leave to amend her complaint so as to cure the technical errors is a final and appealable order because it effectively puts appellant out of court as to KPA. See Gabriel v. O'Hara, 368 Pa.Super. 383, 534 A.2d 488 (1987).
[4]  We note that, on appeal, KPA filed an appellate brief in conjunction with Mediq. However, despite the trial court's pronouncement in its December 11, 1989 opinion, the record contains no appealable order as to Mediq. Thus, we will review only the propriety of the demurrer as to count II of the complaint.
[5]  Appellee argues that the trial court was well within its discretion in refusing to grant appellant leave to amend her complaint because appellant, "having failed to utilize the various procedural remedies available to her to correct a defect in her complaint at the trial level, has waived her right to amend her complaint." Appellee Brief at 7. This claim is meritless. Appellant requested leave to amend her complaint at the trial level in her response to appellees' preliminary objections. She also attached a copy of her proposed amended complaint to her response. Thus, the trial court was aware of appellant's informal request to amend her complaint at the trial level. Moreover, the trial court, recognizing that appellant had requested leave to amend her complaint, stated in its opinion that had appellant filed a formal motion to reconsider, the court would have granted her leave to amend her complaint.
[6]  This ruling alone is not enough to warrant sustaining preliminary objections to the whole count.
[7]  We need not determine whether the defense raised by the trial court was appropriate in light of the factual circumstances of this case. However, we do note that the complaint is devoid of any information leading to the conclusion that KPA hired Mediq as an independent contractor. In fact, appellant alleges in her complaint that "at all applicable times, defendant KPA was a wholly-owned subsidiary corporation of defendant Mediq." See Appellant's Complaint, R.R. at 5a.
