The plaintiff and the defendant entered into a contract in March, 1882, by which the plaintiff agreed to do the work .of laying water mains in Jerome avenue, in the city of New York, .and the defendant agreed to pay therefor on a basis specified. The work was performed by the plaintiff in due course, and accepted by the superintendent of public works. Payments were made from time to time to the plaintiff down to and after the commencement of this action; the last payment being $1,119.71. Plaintiff’s claim on the trial was that after the last payment there remained due to. him $2,191.81, being for 337.4 cubic yards of rock excavation at $2.95 per yard; 2,504.2 cubic yards of earth excavation at 33 cents per yard,' and 2,843.1 cubic yards of filling at 13 cents per yard; such being the prices specified in the contract for such work. The contract provided that the trench should be excavated two feet wider than the diameter of the pipe' and one foot deeper than the bottom of the pipe, .and that whenever, in the opinion of the engineer, it should be deemed necessary to place the pipe deeper, the trench should be excavated to such a depth as the engineer should direct, and the pipe laid accordingly. It appears that the plaintiff has been paid for excavation and filling on that basis. But each piece of pipe laid was 12 feet from hub to hub, and, according to the testimony adduced in behalf of the plaintiff, the pipes could not be laid and the joints made as required by the contract without a still further excavation at the points of intersection. The contract provided, in effect, “that the spigot end of the pipe should be inserted into the hub, and the space around the pipe equalized, so as to give as nearly as possible an equal space for the packing; that the space between the pipe and hub be packed with clean, sound, hemp packing yarn, free from tar, far enough to leave the proper space for the lead, and the remaining space then filled by running it full of lead with a bead outside of the face of the hub large enough to allow for caulking, so that, when the joint was properly caulked, the lead would be flush with the hub of the pipe, and, after the joint should have been run with lead, that it should be caulked by means of proper tools, so as to make a water *317tight joint.” To do this work, a space of 18 inches beyond the huh on each side of the pipe was required. As the hub projected six inches beyond the line of the pipe an excavation of one foot on each side in addition to that required by the contract for the entire length of the pipe was needed. For this additional excavation and filling the plaintiff sought to recover. The learned trial judge, however, held that plaintiff could not recover, because of the making of a final certificate by the engineer, fixing the quantities of rock and earth excavation and filling, under a provision of the contract which reads as follows:
“To prevent all disputes and litigation, it is further agreed by and between the parties to this contract that said engineer shall in all cases determine the-amount or the quantity of the several kinds of work which are to be paid for under this contract, and he shall determine all questions in relation to said work and the construction thereof, and he shall in all cases decide-every question which may arise relative to the execution of this contract on the part of the said contractor, and his estimate and decision shall be final and conclusive, and such estimate and decision, in case any question shall arise, shall be a condition precedent to the right of the party of the second part to receive any money under this agreement.”
The question which we are required to pass on is whether the court erred in receiving the evidence upon which its decision was finally grounded. As the evidence stood when plaintiff rested, it appeared that the plaintiff had performed under and in pursuance of the contract an amount of work for which he was justly entitled to recover the amount claimed by him, and that he had requested the engineer to include the excess of work at the joints in his certificate, which he-had refused to do. The court therefore properly denied the defendant’s motion for a dismissal of the complaint. The defendant, for the purpose of establishing a defense, offered in evidence the engineer’s final certificate of the amount of work done under the contract. This the plaintiff objected to, but his objection was overruled, and the paper was received, which led to the direction of a verdict against him. The effect of the certificate, sunnlemented by the engineer’s testimony, was not to show that plaintiff had not done the-amount of work testified to by him, but to establish an arbitration by a person agreed upon in the contract between the parties. Such a certificate is ordinarily conclusive upon the parties, in the absence-of proof of corruption, or bad faith, or misconduct on the part of the person designated, or palpable mistake appearing on the face of the certificate. Byron v. Low, 109 N. Y. 291, 16 N. E. 45; Sweet v. Morrison, 116 N. Y. 32, 22 N. E. 276; Phelan v. Mayor, etc., 119 N. Y. 86, 23 N. E. 175. It was an affirmative defense, which the defendant was bound to allege if it would make proof of it, for it is a fundamental law of pleading and evidence that the proof must follow the allegations of the pleadings. This it did not do. Indeed, there was nothing whatever in the answer suggesting such a defense. Its admission, therefore, was error. Woolsey v. Trustee of Village of Ellenville, 69 Hun, 489, 23 N. Y. Supp. 410; Wright v. Delafield, 25 N. Y. 266; Day v. Town of New Lots, 107 N. Y. 148, 13 N. E. 915; Reed v. McConnell, 133 N. Y. 425, 31 N. E. 22.
After the court had directed a verdict in favor of the defendant. *318the learned counsel for the defendant, appreciating that the defense upon which he had succeeded was not to be found in the pleadings, asked that the answer be amended by inserting an allegation setting forth the clause in the contract in respect to the certificate of the engineer, and an allegation that the certificate which had been offered in evidence was.given by the engineer. While the motion was granted by the trial court, it has not helped the situation, for the granting of it was error. The general rule that the court may so amend pleadings as to conform them to the facts proved is not applicable to this case. It is not a case of mere variance or defect, but an attempt to amend a pleading after trial by alleging a defense not hinted at in it, and where the evidence upon which the motion was founded was received against the objection of the plaintiff. If this could be done, the useful object which pleadings now serve in our system of jurisprudence would not be achieved. Instead of advising an adversary of the issue tendered, it would be possible to recover on a cause of action entirely different from that alleged, or, as in this case, to succeed upon a defense when the plaintiff has had no warning that he would be called upon to meet it.
The judgment should be reversed, and a new trial granted, with costs to appellant to abide the event. All concur.