Opinion by
Mr. Justice Wolverton.
1. The corporations and persons entitled to sue and recover upon official undertakings of the nature of the one set out herein are appropriately and sufficiently designated by statute. Section 340, Hill’s Code, provides that “The official undertaking or other security of a public officer to the state, or to any county, city, or other municipal or public corporation of like character therein, shall be deemed a security to the state, or to such county, city, town, or other municipal or public corporation as the case may be, and also, *405to all persons severally for the official delinquencies, against which it is intended to provide.” Section 341 provides that “When a public officer, by official misconduct or neglect, shall forfeit his official undertaking or other security, or render his sureties therein liable upon such undertaking or other security, any person injured by such misconduct or neglect, or who is by law entitled to the benefit of the security, may maintain an action at law thereon in his own name, against the officer and his sureties, to recover the amount to which he may by reason thereof be entitled.” These sections were intended to give a right of action upon the undertaking directly to the real party in interest, whether it be the state, a municipal, or public corporation, or to a private individual. This construction is borne out by reading in connection therewith sections 343 and 344; and, indeed, such is the judicial interpretation thereof. See Habersham v. Sears, 11 Or. 436 (5 Pac. 208); Howe v. Taylor, 6 Or. 284; Crook County v. Bushnell, 15 Or. 169 (13 Pac. 886). Tases levied for state and county purposes, when collected, belong to the county in which they are levied. The same may also be said of tases levied for school purposes, until apportioned to the several school districts. The county becomes a debtor to the state to the estent of the state’s levy apportioned to such county: Commissioners of Multnomah County v. State, 1 Or. 359; State v. Baker County, 24 Or. 141 (33 Pac. 530). The purpose of the action upon the undertaking being to recover for tases levied for state, county, and school purposes, and collected by the defendant Kelly as tas collector of Multnomah County, that county would be a proper party plaintiff therein although the bond runs in the name of the State of Oregon. Of this there can be no doubt.
*4062. It is claimed that the court below committed error in disallowing plaintiff’s motion for leave to amend the complaint by adding Multnomah County as a party plaintiff, and section 101, Hill’s Code, is invoked in support of the contention. It provides that “The court may, at any time before trial, in furtherance of justice, and upon such terms as may be proper, allow any pleading or proceeding to be amended by adding the name of a party or other allegation material to the cause, and in like manner and for like reasons it may, at any time before the cause is submitted, allow such pleading or proceeding to be amended by striking out the name of any party, or by correcting a mistake in the name of a party,” etc. It has been settled by this court that under the section quoted from it is within the discretion of the trial court, at any stage of the case before the cause is submitted, to authorize such amendments as may be necessary to make the cause as intended by the original pleading, but not to insert a new and distinct cause of action or defense: Foste v. Standard Insurance Company, 26 Or. 449 (38 Pac. 617). So that it is not permissible to allow an amendment which would substantially change the cause of action. We understand from the briefs of counsel, and are led to assume, that the court below disallowed the amendment, not in the exercise of its discretion, but solely upon the ground that it believed it had no power to grant the plaintiff leave to so amend. We will therefore consider the question here as one of power in the court, and not as an abuse of its discretion in the premises. If the proposed amendment would substantially change the cause of action, it may be conceded that the court was without power to allow it; and the converse of the proposition-may also be conceded. It seems the plaintiff insti*407tuted the action in the exercise of his prerogative functions as the law officer of the state and of the several counties constituting his district, to recover in behalf of Multnomah County; not that he claimed an individual interest in the funds sought to be recovered, but for the reimbursement of the county for funds belonging to it collected by the defendant Kelly, and for which he failed to account. In reality it may be considered as an action brought by the law officer of the county to recover for its use and benefit. In this view of the matter it is not conceived that the cause of action would be in any way changed by allowing the amendment. A general test as to whether a new cause of action would be introduced, by a proposed amendment is to inquire if a recovery had upon the original complaint would bar a recovery under the complaint if the amendment was allowed, or if. the same evidence would support both, or the same measure of damages is applicable, or both are subject to the same plea: 1 Ency. of PI. and Pr. 556; Liggett v. Ladd, 23 Or. 26 (31 Pac. 81); Lumpkin v. Collier, 69 Mo. 170.
Many cases are to be found establishing the doctrine that the party for whose use the action is brought may be substituted for the nominal plaintiff, where the legal right of action is shown to be in the former. So, where a party sues in his own right, he may, if the facts warrant, amend his complaint so as to make the suit stand in a representative capacity; and conversely, if he sues in a representative capacity, he may be allowed to amend by declaring in his individual capacity; and in neither instance is it considered a substantial change of the cause of action: Price v. Wiley, 19 Texas, 142; Martel v. Somers, 26 Texas, 551; Wilson v. First Presbyterian Church, 56 Ga. 554; Harris v. *408Plant, 31 Ala. 639; Montague v. King, 37 Miss. 441; Wood v. Circuit Judge, 84 Mich. 521 (47 N. W. 1103); Morford v. Dieffenbacker, 54 Mich. 593 (20 N. W. 600); Lewis v. Austin, 144 Mass. 383 (11 N. E. 538); Buckland v. Green, 133 Mass. 421; Wells v. Stomback, 59 Iowa, 376 (13 N. W. 339). In the last case cited the original petition was entitled “Washington Township, by W. B. Wells, Township Olerk, Kenedy, Lore, and Kingston, Township Trus>tees,” as plaintiff. A demurrer to this petition was sustained upon the ground that plaintiff had no legal capacity to sue. An amended petition was then filed, entitled “W. B. Wells, Olerk of Washington Township, as Plaintiff,” and this, under a statute similar to ours, was allowed to stand. In deciding the case, Seevees, J., says: “We are asked ‘whether the plaintiff, having commenced the suit in the name of Washington Township, could amend the petition making the clerk plaintiff.’ In Township of West Bend v. Munch, 52 Iowa, 132, (2 N. W. 1047,) it was held a township did not have the legal capacity to sue. This being so, it is claimed there was no plaintiff named in the original petition, and, therefore, none could be substituted; that an amended petition could not be filed because there was nothing to amend. But we think, when there is an appearance to the action, and the defendant tests the right of the named plaintiff to maintain the action by a demui’rer, and the latter is sustained, the name of the proper parties plaintiff may be substituted in the action by an amended petition, subject of course to an apportionment of the costs, and the right of the defendants to a continuance if taken by surprise. If this is not the rule, the action must abate, and another be brought. This, under the statute, should not be the rule unless substantial justice so demands. The statute in terms provides that the court, in *409furtherance of justice, may permit a party to amend any pleading* ‘by adding or striking* out the name of a party ® * * or by inserting other allegations material to the case, or, when the amendment does not change substantially the claim or defense, by conforming the pleadings or proceedings to the facts proved’: Code, § 2689. The defendants could make their defense in this action as well as in a new one, and they could not have been prejudicially affected by the amendment.” So it is here, the defendants could make their defense, if the amendment was allowed, as well as now, in so far as it is apparent their defense would not be changed. The complaint, with the proposed amendment, discloses the same issuable facts as the one on file, the same evidence would support both, and the same measure of recovery is applicable. We think that under these authorities the court had the power to grant the amendment.
3. But it would appear, notwithstanding, that the motion was rightly and appropriately disallowed. As we are advised, one of the grounds for sustaining the demurrer to the original complaint was that the action was brought by the plaintiff without having obtained leave of the court or judge thereof where the action is triable as required by section 842, Hill’s Code. At least, the complaint does not show that such leave had been obtained. The proposed amendment, if allowed, would leave the complaint subject to the same objection, as the county could not sue upon the undertaking without having obtained leave for that purpose, which fact must be alleged: Crook County v. Bushnell, 15 Or. 169 (13 Pac. 886).
*4104. Where the amendment, if allowed, would leave the complaint subject to objections that it was intended to obviate, it is proper to reject it. While courts are always liberal in allowing amendments in furtherance of justice, and that the real object of the dispute may be reached and finally determined, they will not do a vain thing. For these reasons the judgment of the court below will be affirmed.
Affirmed.