Opinion by
Mr. Justice Stewart,February 14, 1910:
In considering this case it is necessary first of all to determine the legal relation inter se of the parties to the controversy. The defendant company, here the appellant, having determined upon an extension of its railroad, accepted the bid of one Petrie, who had been secretary of the company but had resigned to enter into new relation towards it, for the entire completion of the proposed work according to the plans and specifications prepared by the company, for the sum of $400,000 in cash, and a like amount in the mortgage bonds of the company. A formal contract was thereupon entered into between Petrie and the company by which the former engaged to construct and complete the proposed work in the manner and within the time called for by the specifications, and the latter agreed to pay for the work accordingly. This contract is dated April 25, 1901. On May 24, following, Petrie, with the consent and approval of the railroad company, entered into a written contract with the Pittsburg Construction Company, here the appellee, which contract, except as it differs with respect to the consideration to be paid for the work, is simply a transcript of the contract between Petrie and the *94railroad company, and was an undertaking by the construction company to do the work which Petrie by his contract with the railroad company had engaged to do, but upon which he had not entered. Immediately following the signature of the parties to this later contract this appears, “For value received the Westside Belt Company and John S. Scully and F. S. Barnsdall do hereby guarantee and become surety for the payment of the money mentioned in the within contract as the same becomes due and payable.” This is followed by a due execution by the parties named. The authority of the president of the railroad company to enter into this obligation on behalf of the company is conceded. With Scully and Barnsdall we have no present, concern; our inquiry relates only to the railroad company, and the measure of its liability. In -this action it is sought to charge it as a principal, primary debtor, notwithstanding by the written terms of the obligations, the liability expressed is that of guaranty and surety. This presents the first question for our consideration. On behalf of appellant it is claimed that the obligation it incurred was that of guarantor, and that its liability, therefore, is secondary. Much depends on the answer to be given. Assuming a secondary liability on the part of the railroad company, the argument derives conclusions most prejudicial to the construction company’s present demands, as will appear later on. The assumption, however, takes account of but a single covenant in the obligation, whereas there are two distinct covenants, one of guaranty and one of suretyship. There is no contention that the obligation is to be considered in any other way than in accordance with its express terms. It is not even suggested that the clear distinction that exists in law between the two relations of guarantor and surety was overlooked, and that all that was intended was a contract of guaranty. The assumption is palpably without warrant. Having once entered into a covenant of both guaranty and suretyship, it could not thereafter be optional with the covenantor to determine in which of the two relations it would stand; it was, however, for the other party to elect under which it would pursue its remedy for any default. As surety, the railroad *95company here took upon itself a direct and immediate liability. Suretyship always implies original undertaking, and the measure of liability in such case is the extent of the principal’s liability. A surety assumes to perform the contract of the principal debtor, if the latter should not, and the undertaking is immediate and direct that the act shall be done, which if not done, makes the surety responsible at once: Reigart v. White; 52 Pa. 438; Riddle v. Thompson, 104 Pa. 330; Phila. & R. R. Co. v. Knight et ah, 124 Pa. 58. If regard be had to the situation of the parties and the object they had in view, it would require no strained construction of the obligation to impose on the railroad company the obligations of a principal debtor. So far as concerns this dispute, the distinction would come to nothing, for the liability to the appellee would be the same whether principal or surety. The appellant under either contract was to pay the money. It contracted with Petrie that it would pay to him. Petrie, under his later contract with the construction company, contracted that the railroad company would pay directly to the construction company. The debt incurred in building the railroad was in either case to be paid by the railroad company. It is somewhat anomalous for one to become surety for the payment of money due from himself; and yet if we confine ourselves to the strict letter of the obligation, that is what the railroad company did in this instance. When it signed the obligation of suretyship “for the payment of the money mentioned in the within contract as the same becomes due and payable,” since the money was due from itself, it might well be argued that it was an assumption of liability as principal debtor. The subsequent dealings between the parties show very conclusively that both so understood the relations between them. We conclude on both grounds that the written contract between Petrie and the construction company is the law governing the present case, quite as much as though the appellant’s name appeared therein as a contracting party.
The contract between Petrie and the construction company, as well as the earlier contract between Petrie and the railroad company, contained the following provision: “When this *96agreement, in all its parts and in the manner herein provided, shall have been completely performed on the part of the contractor, and such performance shall have been accepted and so certified in writing by the said chief engineer, a final estimate of the quantity, character and value of the work done and materials furnished, according to the terms of this agreement, shall be made by the chief engineer, and thereupon and not otherwise sooner, except at its own election, the railroad company shall within thirty days thereafter pay to the said contractor .... all sums of money so certified by the said chief engineer to be then remaining due and unpaid upon the work performed under this agreement, after first deducting therefrom any and all sums herein provided to be retained by the said railroad company; it being expressly understood that such final estimate and certificate of the chief engineer shall be conclusive upon the parties.” Both contracts contained this further provision: “And it is mutually agreed and distinctly understood that the decision of the chief engineer shall be final and conclusive in any dispute that may arise between the parties to this agreement relating to or touching the same, and each and every of said parties do herein waive any right of action, suit or suits, or any other remedy in law, or otherwise by virtue of said covenant so that the decision of said Chief Engineer, James H. McRoberts, shall in the nature of an award be final and conclusive on the rights and claims of said parties.” The present action was brought to recover on an award made under the last quoted provision by the chief engineer, McRoberts, for $332,750.98 in favor of appellee as against Petrie. The document purports to be the report of an “arbiter between the Pittsburg Construction Company, subcontractor, and A. S. Petrie, contractor for West Side Belt Railroad Company.” For a correct understanding of the actual dispute a further recital of facts is here required. At the inception of the transaction, McRoberts was chief engineer. Later on as the work progressed he was made consulting engineer and H. T. Douglas was substituted as chief engineer. The work of construction was very largely in excess of what was originally contemplated. The entire work was to have *97been completed within a year, but eighteen months more were required, and it was not until June 11, 1903, that through the chief engineer, Douglas, the construction company was notified of its acceptance. Thereupon Douglas began preparations for making an estimate of the work done. About September 10, following, he completed his estimate, which showed there was due the construction company the sum of $82,324.03. This estimate, signed by himself and certified by the consulting engineer, McRoberts, as correctly summarized, was handed to Mr. Donnelly, the vice president of the railroad company. The day following, McRoberts obtained this estimate from Donnelly, and in the latter’s office entered upon it the following items: “ Less liquidated damages on account of nonfulfillment of contract $92,970.74.” “Over Payment on contract $14,676.71.” Thus bringing the construction company in debt in the sum of $25,323.42. McRoberts testified that he did this at the instance and request of Donnelly; and in this he is not contradicted. The day following, Donnelly submitted the award as thus amended to the counsel of the railroad company, and was advised that the items added by McRoberts did not properly fall within the purview of a final estimate, but were proper subjects for consideration and judgment by the chief engineer as arbiter; and that inasmuch as McRoberts, as chief engineer, was named as arbiter in the contract, he should be reappointed to that place. His appointment accordingly was made September 16, 1903. Immediately thereupon he served the following written notice, prepared by counsel of the railroad company, upon the construction company: “Gentlemen: I have about completed the final estimate for your work under your contract with the West Side Belt Railroad Company, and as the chief engineer mentioned in the contract, to whom has been committed the final decision of all disputes between the parties, before finally submitting the estimate to you I wish to notify you that the railroad company claims of me a deduction for credit on the final estimate of the damages sustained by the Railroad Company owing to the delay in the completion of the contract. If you wish to be heard upon this question, I will meet your representative and the representa*98tives of the Railroad Company at my office in the Farmers Bank Building on Monday, September 21st, at 10 o’clock a. m. ; or, if this time may be inconvenient to you, upon your suggestion I will try and fix a date and place that will suit your convenience.” At the first meeting under this notice the appellant company appeared and submitted its claim for damages amounting to $96,970.74; but it nowhere appears that either then "or at any subsequent meeting appellant offered any evidence in support'of the claim. The appellee, on the other hand, submitted a claim for extra work which it alleged was not included in the estimate prepared by Douglas, amounting to nearly $300,000. It does not appear that anyone connected with the construction company up to this time had any knowledge of the estimate prepared by Douglas, and by him delivered to the vice president of the railroad company. The written notice served by McRoberts, at the instance of the railroad company, clearly implied that no final estimate had as yet been made, and that none had been completed. The arbitration thus entered upon proceeded, and both parties participated in an exhaustive investigation, both upon the items embraced in the Douglas estimate as well as other matters in dispute, without objection or protest. The thoroughness and extent of the investigation may be judged from the fact that in the fifty-two hearings that were held more than 2,000 pages of testimony were taken and 500 exhibits filed. • Each side produced witnesses, and cross-examined the opposing witnesses, touching the claim asserted .by the construction company. Upon this state of facts, undisputed, the trial judge held that there could be but one inference, namely, that both parties by common consent disregarded and ignored the Douglas estimate, and proceeded as though such paper had never existed. He accordingly directed a verdict for the plaintiff for the amount of the arbiter’s award. This ruling necessarily implied a waiver by defendant of all claim under the Douglas estimate; and the contention now made on behalf of appellant, is that this was a question of fact that the jury alone could determine. The sufficiency of the Douglas estimate to meet the requirements of the contract need not be considered except *99incidentally. It is quite true that ordinarily the question of waiver is one of fact for the jury; but it is not always so. When the facts are undisputed, it becomes a matter of legal inference. Waiver rests fundamentally on the doctrine of estoppel; but where the facts are ascertained whether the doctrine applies is for the court to decide: Lewis v. Carstairs, 5 W. & S. 205. The facts here relied upon as establishing a waiver are, first, the notice from McRoberts as arbiter; and, second, the active participation of the defendant without protest in an arbitration which asserted jurisdiction to make and conclude a final estimate regardless of what had been done before. The notice from McRoberts calling for the arbitration must be taken as the act of the defendant company; the demand for the arbitration came from it, and the notice was prepared by its own counsel. It contained an express acknowledgment that up to that time no final estimate had been completed, and an equally express acknowledgment that the final estimate when made was to be made by McRoberts. The language of the notice was: “I have about completed the final estimate.....Before finally submitting the estimate to you I shall,” etc. It was pursuant to this notice that the defendant company was present, through its representative, at the arbitration, submitted its claim for damages, and acquiesced without protest or objection in the jurisdiction asserted by the arbiter to hear and determine, not only all matters in dispute, but in particular such matters as were essential to the completion of a final estimate of the work done by the plaintiff company; never once asserting the Douglas estimate as a bar, or indicating any reliance upon it as the final estimate. In this connection it is to be remembered that the Douglas estimate remained in the hands of the defendant company. The fact of its existence had never been communicated to the plaintiff company, and so far as appears no copy of it was ever served upon the plaintiff company, the party best entitled to it, since as originally delivered it contained an award in its favor. Under such state of facts, about which there was no contention, it was not error in the trial judge to pronounce upon the effect of the evidence. He rightly concluded that had the case gone to the jury, and a *100verdict been rendered against such proofs, the court would have been bound to set it aside. “When it is the duty of a judge to control a verdict he is not to be reversed for exercising his authority in advance of the verdict, and saving thereby the delay and expense of a new trial:” Graff v. Railroad Co., 31 Pa. 489. It follows that the McRoberts award became the true measure of appellant’s liability, whether the latter be regarded as principal or surety. The assignments of error raise no question as to its sufficiency as an award under the contract between the appellee and Petrie. If sufficient under that contract, it fixes appellant’s liability. On the argument of the case, it was urged upon our attention that the arbiter in his report expressly states that in reaching his conclusions he disregarded as irrelevant some evidence and claims, which might be relevant in a final settlement between the appellant and the contractor. But we have no assignment of error challenging the sufficiency of the award as an award. When offered in evidence on the trial of the case a single objection was made to its admission, namely, that the award was “ between the plaintiff and A. S. Petrie, subcontractor, for the doing of this work, but who is not a party to this suit.” This objection was properly overruled. The appellant was a party to the inquiry before the arbiter, was duly served with notice, attended the meetings and participated in the investigation. It had all the rights Petrie would have had in making defense. The award was a common-law award, which according to the express agreement of the parties was to be “final and conclusive on the rights and claims of said parties.” Under such stipulation the parties take the hazard of mistake in the tribunal they have selected, and the award is not to be set aside for mere mistake of law or fact. “Unless the evidence offered and received in the court below tended to prove something more than mere mistake of fact or of law; unless it went to establish misbehavior on the part of the arbitrators, or the plaintiff, it was inadmissible to affect the award upon which the suit was brought:” Speer v. Bidwell, 44 Pa. 23. If appellant would derive from the admission in the report itself an inference of misconduct on the part of the arbiter, that point *101should have been made in the court below. The objection to the award comes too late, since we are here confined to the consideration of only what is assigned as error.
After the filing of the award, and previous to the bringing of the present action, the appellee brought suit in the United States circuit court for the western district of Pennsylvania, against the West Side Belt Railroad Company, John S. Scully and Theodore N. Barnsdall, for the recovery of the amount of the award, in which action it was sought to charge the parties named on their contract of guaranty and suretyship. A verdict was directed for the plaintiff for the full amount of the award, subject to the court’s decision on a point reserved. Subsequently judgment non obstante was entered for the defendants. It appeared on the trial that the plaintiff was a West Virginia corporation chartered May, 1901, and that its contract with Petrie had been entered into May 24, 1901, whereas the corporation had not been registered in this state until June 15, following. This sufficiently indicates the point reserved. Our Act of assembly of April 22, 1874, P. L. 108, provides that it shall not be lawful for any such [foreign] corporation to do any business in the commonwealth until it shall have filed in the office of the secretary of the commonwealth a statement under the seal of the said corporation, and signed by the president or secretary thereof, showing the title and object of said corporation, the location of its office or offices, and the name or names of its authorized agent or agents therein; and that the certificate of the secretary of the commonwealth, under the seal of the commonwealth, of the fifing of such statement shall be preserved for public inspection by each of said agents in each and every of such offices. Because of the admitted failure of the plaintiff company to comply with the provisions of this act before entering into the contract, the court held that there could be no recovery on the contract. The judgment rendered was as follows: “Judgment therefore will be entered in favor of the defendant non obstante veredicto, but such judgment shall not bar, in subsequent suit or proceeding by the plaintiff for services performed.” On appeal, the judgment, saving the right of plain*102tiff to bring an action on a quantum meruit for work done, was affirmed by the United States circuit court of appeals. The record of that case was pleaded in bar in this. In reply plaintiff invoked the Act of May 23,1907, P. L. 205, which provides: “That whenever any corporation, organized and existing under the laws of any other state and doing business within this commonwealth, shall have heretofore entered into any contract, bond or obligation with any person, firm or corporation, without having first established a known place or places of business and designated an authorized agent or agents for the transaction of its business in this commonwealth, the said contract, bond or obligation shall be binding upon the parties thereto and such corporation may enforce the same in the courts of this commonwealth; provided, that it has subsequently, and prior to the passage of this act, complied with the laws of this commonwealth by establishing a known place or places of business and designated an authorized agent or agents for the transaction of its business within the same; and provided further, that it shall, before commencing any suit upon such contract, bond or obligation pay all taxes that would have accrued to the commonwealth of Pennsylvania if it had complied with the laws of Pennsylvania at the time of beginning to do business therein.” The plaintiff’s full compliance with all that is required under this act was shown. The court held that the present action was not barred by the judgment in the cii’cuit court. We are of opinion that the ruling was correct. We may concede that so far as concerns the appellant here the parties were the same, and that the cause of action was the same in both suits; but it remains true nevertheless that the adjudication of the circuit court of the United States was not on the merits of the case. The judgment there clearly and certainly discloses this much. It is based exclusively on the plaintiff’s disability to maintain the action because of its failure to register within the state before the contract sued upon was entered into; it expressly reserves to the plaintiff the right to sue for services performed. “The judgment must be upon the merits; if the real merits of the action are not decided in the prior judgment, it is no bar:” *103Herman on Estoppel, 278. Our own cases have uniformly recognized the doctrine here asserted. In Carmony v. Hoober, 5 Pa. 305, it is said: “The maxim which forbids a second judicial agitation of rem judicatam by the same parties or their privies, is one of essential consequence in its application, and therefore to be rigidly adhered to within the bounds that have been assigned to it. But we think it has never been carried to the verge to which the learned judge before whom the cause was tried has pushed it in the present instance. On the contrary, it has been held an acknowledged principle, that when it can be gathered from the record, the merits of the controversy were not passed upon in the first action, but the determination proceeded upon some technical objection not affecting the plaintiff’s ultimate right to sue, the first judgment will constitute no bar to the second suit; for, as was observed by a very eminent jurist, in such case the argument that the causes of action were the same is virtually negatived. (Per Story, J., in Hughes v. Blake, 1 Mason, 515.) This exception to the maxim invoked by the defendant in error, if indeed it can strictly be called an exception, since it assumes the character of a general rule, is almost, if not altogether, coexistent with the rule itself. . . . The rule is the same if the first cause went off because the court had not jurisdiction, or because the debt or duty sued for was not then due: Estill v. Taul, 10 Tenn. 466; or, as was determined by this court in Kane v. Fisher, 2 Watts, 246, where the record shows that part of a demand, consisting of several articles capable of being separated, was not due, though counted for at the time of suit brought. But approaching somewhat nearer to the precise point presented for adjudication by the case at bar, it will be found that when it appears the first suit was prematurely commenced no advantage can be taken of a judgment rendered therein against the plaintiff, unless indeed it be shown the parties waived the irregularity and consented to an investigation of merits. Thus it has been correctly decided that a judgment rendered in favor of the defendant, in an action against the indorser of a promissory note, brought before notice given, cannot be set up as a bar to a second action after *104notice, because it is apparent that in the first suit the plaintiff had no cause of action: New England Bank v. Lewis, 25 Mass. 113. Many similar cases might be cited, all proceeding on the ground that where the merits of the second suit were necessarily excluded in the former, the plaintiff ought not to be barred.' Indeed, a contrary rule would be founded in such rank injustice as to be insupportable, and had such an one been even entertained in the earlier ages of the law, when reason and truth were but too often made to give way before the fancied force of technical subtleties and hair-drawn distinctions, it must long since have succumbed to the enlightened wisdom which tolerates litigation only as a means of administering uniform justice.” In Coleman’s App., 62 Pa. 252, it is said by Sharswood, J.: “Whenever a judgment is relied on for this purpose, it is competent for the adverse party to show that the particular point was not adjudicated, if in law, it could have been rendered upon any other. . . . The principle is well stated by Mr. Justice Nelson in Washington, etc., Steam Packet Company v. Sickles, 72 U.-S. 580: 'As we understand the rule in respect to the conclusiveness of the verdict and judgment in a former trial between the same parties, where the judgment is used in pleading as a technical estoppel or is relied on by way of evidence as conclusive, per se, it must appear, by the record of the prior suit, that the particular controversy sought to be concluded was necessarily tried and determined — that is, if the record of the former trial shows that the verdict could not have been rendered without deciding the particular matter, it will be considered to have settled that matter as to all future actions between the parties; and further, in cases in which the record itself doesmot show that the matter was necessarily and directly found by the jury, evidence aliunde consistent with the record may be received to prove the fact, but even where it appears from the extrinsic evidence that the matter was properly within the issue controverted in the former suit, if it be not shown that the verdict and judgment necessarily involved its consideration and determination, it will not be conclusive.’ ” Haws v. Tiernan, 53 Pa. 192; Follansbee v. Walker, 74 Pa. 306; Weigley v. Coffman, 144 *105Pa. 489, are among our own cases which are to the same effect. The prior adjudication settled nothing with respect to the merits of this case; all that was there adjudicated was the plaintiff’s right to maintain its action as an unregistered foreign corporation. Wherein does the present case differ from the case of Bank v. Lewis, 25 Mass. 113, approvingly cited by Bell, J., in Carmony v. Hoober, 5 Pa. 305, in which it was held that a judgment rendered in favor of a defendant in an action against the indorser of a promissory note brought before notice given, cannot be set up as a bar to a second action after notice, because it was apparent that in the first suit plaintiff had no cause of action? The case of Roney v. Westlake, 216 Pa. 374, so much relied upon by appellant’s counsel as sustaining a different view, conflicts in no respect with the cases we have cited. That case decided that a verdict and judgment in favor of a defendant in an action on a promissory note which was not stamped with an internal revenue stamp is res judicata as to a subsequent action between the same parties on the same note after a revenue stamp had been placed thereon. The ground on which the decision was rested was that in the first action because of express provision in the act of congress disqualifying unstamped instruments as matters of evidence, the note itself not being admissible, the plaintiff was without competent evidence to establish his claim, and having submitted his claim to the jury and permitted a verdict and judgment to go against him, he was concluded because the verdict was the result of failure to establish the claim by competent evidence. Our Brother Mestkezat, in his opinion in that case, clearly marks the distinction that is to be observed. He says: “The case in hand must be distinguished from that class of cases where the judgment set up in bar of the second action is not upon the merits of the question involved in litigation. Those cases are where the judgment is founded upon a lack of jurisdiction, a nonjoinder or misjoinder of parties, plaintiff or defendant, a misconception of the form of pleading, a formal or technical defect in the pleadings, or the like: 24 Am. & Eng. Ency. of Law (2d ed.), 794; or where the suit is discontinued, the plaintiff becomes *106nonsuit, the debt is not yet due, or there is a temporary disability of the plaintiff to sue: 1 Greenleaf on Evidence, secs. 529, 530; Weigley v. Coffman, 144 Pa. 489. Judgments in those cases are not obtained upon the merits, and hence are not a bar to another action.” The effect of the act of May 23, 1907, was to remove the impediment created by the prior act to the enforcement of the contract, and the plaintiff at once acquired the right to maintain an action thereon.
. It is unnecessary to pursue the inquiry further. The plaintiff having complied with all the provisions of the act of 1874, it was in position to enforce by action at law the contract between it and the defendant. In what we have said the several assignments of error have all been considered. They are overruled and the judgment is affirmed.