Opinion by
Aenold, J.,This action in assumpsit was to recover a balance of $2,750 for labor and materials furnished by the plaintiff, a subcontractor to the defendant contractor. The pleadings consisted of .complaint^ amended: answ.er and *623counterclaim, with preliminary objections to the counterclaim, and a motion.by plaintiff for judgment for part of the demand. The court below sustained objections to the counterclaim and gave judgment to the plaintiff for a part of the alleged debt, and defendant appealed. We are of the opinion that the case was disposed of too summarily.
The complaint alleged full compliance by the plaintiff with three different contracts from the defendant, but treated these as one contract, setting up a payment of $1,100 by defendant as a credit against the whole of the plaintiff’s claim. The amended answer averred that the plaintiff did not perform the contracts and that certain specified materials and labor were not supplied, and that the plaintiff refused to complete the work although requested so to do.
If the plaintiff refused to perform, the burden was on it to show that the refusal was not wilful, and that the performance was substantial. The doctrine of substantial performance is intended for the protection of those who have faithfully and honestly endeavored to carry out their contracts, so that their right to compensation shall not be forféitéd by technical, inadvertent or unimportant omissions or defects. Therefore it is incumbent upon him who invokes this protection (as does the plaintiff here) to present a case in which there is no wilful omission or departure from the terms of the contract. If the plaintiff here fails so to do, the question of substantial performance is not to be submitted to the jury: McAdams v. Smith, 65 Pa. Superior Ct. 568; Typhoon Air Conditioning Co., Inc. v. Fried et al., 147 Pa. Superior Ct. 605, 24 A. 2d 926; Wright et al. v. Barber, 270 Pa. 186, 113 A. 200; Balis Bros. v. Latta, 102 Pa. Superior Ct. 66, 156 A. 596.
Since the pleaded.defense is to all. of the plaintiff’s claim, no judgment could be-entered for any part of it."'
*624We agree with the court below that the counterclaim filed was unquestionably bad. The gist of the part of the counterclaim rejected was “That by reason of faulty and defective work and materials, Defendant was obliged to reduce the price which was to be paid by the owners. . . The reduction from the agreed upon price amounted to $2,500.00.” This is not a proper measure of damages. Certainly if the owner of the building got the defendant to reduce the price $10,000, no one would attempt to say that this loss could be imposed upon the present plaintiff. The question is what loss the defendant suffered by plaintiff’s breach, and the measure of damage is not the amount the owner gained. Nor is any alleged loss of profit to be pleaded or proved by the mere agreement between defendant and owner. However, since the case must go back for trial on the merits, defendant is given leave to amend its counterclaim within such time as the court below may fix.
Judgment reversed with a procedendo.