delivered the opinion of the court.
This proceeding was commenced in the district court of Carbon county to secure a writ of mandate to compel the defendant to pay over to the relator $2,146.88 on account of certain special improvement bonds issued by special improvement district No. 27 of the city of Red Lodge, Montana, and owned by the relator.
The action came on for hearing May 8, 1934, with Judge Goddard of the thirteenth judicial district presiding. After some preliminary proceedings and the testimony of one witness had been partially taken, Judge Goddard, on his own motion, continued the hearing until May 22, 1934. On the last-named *487date the case was taken up for hearing by Judge Stong, the other judge of the thirteenth district. The defendant objected to proceeding under Judge Stong, but the court held that the partial hearing had before Judge Goddard on May 8 was a mistrial, and the hearing of the case w_s proceeded with. Judgment was rendered in favor of the relator, and the writ was issued directing the city treasurer to pay over to the relator the amount prayed for in his petition. This appeal is from the judgment.
Defendant, appellant here, in his brief assigns six separate and distinct errors, but in his argument groups the last five in one and they will be treated in like manner here. The first assignment is “the trial judge was without jurisdiction to hear and determine this action.” This assignment is based upon an alleged error by the court in overruling defendant’s objection to proceeding with the hearing under Judge Stong. In a subsequent controversy between counsel it appears that a stenographer called in to take the place of the official stenographer could not take the testimony, and for that reason the case was continued by Judge Goddard. After extended comments by counsel of both parties, Judge Stong stated that Judge Goddard had advised him he did not wish to proceed in the matter, and that “the record may show that as regards the proceedings concerning the trial that was had on May 8, 1934, the court declares that a mistrial, and you may proceed with the trial at this time.”
The objections made by the defendant to Judge Stong’s presiding were general in nature. No intention to disqualify Judge Stong appears from the objection made, and it is not contended that the hearing, conducted as it was, resulted in any injury to the defendant.
“No litigant or party to an action or proceeding has any vested right to have his cause heard before a particular judge.” (State ex rel. Little v. District Court, 49 Mont. 158, 141 Pac. 151, 152.) There was nothing improper in Judge Goddard’s continuing the hearing. Granting or refusing to grant a continuance is at any time within the sound legal dis*488eretion of the court (Borden v. Lynch, 34 Mont. 503, 87 Pac. 609; Hunt v. Van, 61 Mont. 395, 202 Pac. 573), and “its exercise in any case is not subject to review by this court, in the absence of an affirmative showing that the complaining party has suffered prejudice” (Downs v. Cassidy, 47 Mont. 471, 133 Pac. 106, 107, Ann. Cas. 1915B, 1155). The court may order a continuance on its own motion. (Curry v. McCaffery, 47 Mont. 191, 131 Pac. 673.) We think the general rule is accurately stated in 64 Corpus Juris, page 67, where it is said: “Except where it is prohibited by statute a change of the presiding judge during a trial is not a fatal irregularity unless actual prejudice results to a party by reason thereof.”
Both the judges in this ease were the regularly elected and qualified judges of the thirteenth judicial district, and had equal authority to preside in this ease. The proceedings in this particular, while informal and slightly irregular, furnish no ground for reversible error.
It is next contended that the city is a necessary party defendant. When the act sought to be compelled is an act that a particular official is authorized to do, and nothing remains to be done by the city or any other officer or board, the particular official is the only necessary party. (38 C. J., sec. 555, p. 852.)
In Powell v. People, 214 Ill. 475, 73 N. E. 795, 105 Am. St. Rep. 117, 2 Ann. Cas. 551, it is said: “Generally speaking, all persons interested in the matter involved must be made parties. * # * On the other hand, however, it is not the practice to make any other person respondent than the officer failing or refusing to perform a plain duty.” (See, also, note 105 Am. St. Rep. 117, pages 123, 124, supra, where the general rule is given.)
In Shields, County Collector, v. Grear, City Collector, 55 N. J. L. 503, 27 Atl. 807, in which the county collector of revenue sued a city collector for money collected by the latter for the former, it was shown that a certain amount of money had been collected for the county and remained unpaid. Held, *489that the party who should act, the city collector, only, was a necessary party.
In Krier v. Town of Walsenburg, 26 Colo. App. 150, 141 Pac. 505, in mandamus proceedings to compel the town clerk, who was authorized by ordinance to issue licenses to moving picture concerns, it was held that the mayor and city counsel were not necessary parties.
In Finney v. Smith, 227 Ill. App. 146, it was held that the city was not a necessary party in an action for mandamus to compel the city treasurer to pay a city warrant.
Defendant’s contention that the city is a necessary party in this action we think should have been raised by special demurrer as provided by subdivision 4 of section 9131, Revised Codes 1921, and that, when defendant failed to allege a defect of parties defendant by such demurrer, but proceeded with the trial of the action on the merits, it will be deemed to have waived such defect. (Meredith v. Roman, 49 Mont. 204, 141 Pac. 643; Puckett v. Hopkins, 63 Mont. 137, 206 Pac. 422; State v. Great Falls City Council, 19 Mont. 518, 49 Pac. 15; Board of Commissioners v. Heath, 79 Colo. 429, 246 Pac. 794; State ex rel. Viking Tp. v. Mikkelson, County Treasurer, 24 N. D. 175, 139 N. W. 525.)
On the merits, the material questions raised by the defense we think are: (a) Plaintiff is barred by the statute of limitations, section 9031, Revised Codes 1921; (b) $2,000 paid to the city treasurer for the credit of special improvement district No. 27 was embezzled by him and was never paid to the city; (c) there is only $146.88 in the custody of the present city treasurer to the credit of district No. 27, and mandamus will not lie. These questions will be taken up in the above order.
The legality of the bonds and the liability of the city treasurer are not questioned, except as above; the relator is admitted to be the holder, and demand is shown by the record and payment refused. The defense is largely technical, except the question as to whether mandamus will Re, and that ques*490tion turns on the point as to whether there are funds in the city treasury that may be legally used to pay relator’s demand. (a) In the face of the bond are these provisions:
“This bond bears interest at the rate of six per cent, per annum from the date of registration of this bond, as expressed herein, until the date called for the redemption by the city treasurer. The interest on this bond is payable annually on the first day of January, in each year, unless paid previous thereto, and as expressed by the interest coupons hereto attached, which bear the engraved facsimile signature of the mayor and city clerk.
“The bond is payable from the collection of a special tax or assessment which is a lien against the real estate within said improvement districts, as described in said resolution herein-before referred to.
“This bond is redeemable at the option of the city at any time there are funds to the credit of said special improvement district fund for the redemption thereof, and in the manner provided for the redemption of the same.”
These provisions of the bonds are in accordance with those required by section 5249, Revised Codes 1921. This section further provides: “Whenever there are any funds in any special improvement district fund, after paying the interest on such warrants (or bonds) drawn against said fund, the treasurer shall call in for payment outstanding warrants (or bonds), which, together with the interest thereon to the date of redemption, will equal the amount of said fund on that date, which date shall be fixed by the treasurer, who shall give notice by publication once in a newspaper published in the city, or at the option of the treasurer, by written notice to the holder or holders of such warrants (or bonds), if their address be known, of the number of warrants (or bonds) and the date on which payment will be made, which date shall not be less than ten days after the date of publication or of service of notice, and on which date, so fixed, interest shall cease.”
The city treasurer is the custodian of all city funds, including those in special improvement districts, and he is charged *491by the statutes with the duty of calling such warrants (or bonds) as those involved here when funds are available. When the date of payment is uncertain and dependent on the call of the city treasurer, the statute of limitations does not begin to run until the “call of the treasurer, or until the holder had an immediate cause of action.” (Stagg v. Stagg, 90 Mont. 180, 300 Pac. 539; Norton v. Steinfeld, 36 Ariz. 536, 288 Pac. 3; Menshaw v. Smith, 102 Kan. 599, 171 Pac. 616; Broadwell v. Board of Commissioners, 88 Okl. 147, 211 Pac. 1040; City of Bisbee v. Cochise County, (Ariz.) 36 Pac. (2d) 559.)
When an agreement for the payment of money contemplates an indefinite delay in payment, the statute of limitations does not begin to run until actual demand has been made, or the happening of some event designated as the extreme limit of time for payment. (Vermilyea v. Vermilyea, 61 Cal. App. 608, 215 Pac. 686; Curtis v. Rialto Irr. District, 44 Cal. App. 738, 187 Pac. 117; Freehill v. Chamberlain, 65 Cal. 603, 4 Pac. 646; People v. Honey Lake Valley Irr. Dist., 77 Cal. App. 367, 246 Pac. 819; Little v. Emmett Irr. Dist., 45 Idaho, 485, 263 Pac. 40, 56 A. L. R. 822; Dillon on Municipal Corporations, 5th ed., sec. 865.)
It further appears that substantial amounts were paid each year on bonds of the same issue as those involved here. The statutes provide that such bonds shall be called for payment by the city treasurer either numerically or in the order of the dates of registration. Necessarily the bonds heretofore paid must have been paid only when called by the city treasurer as provided by statute, and it logically follows that relator’s bonds were not called, could not mature until called, and the statute of limitations could not begin to run until the bonds matured.
Defendant’s contention that relator’s action is barred by the statute of limitations cannot be sustained.
(b) We are not impressed by the argument that “the city of Red Lodge did not receive this money” when the record shows, and the defendant admits, that O. J. Simmons, a former city treasurer, regularly received from the county treasurer $2,000 for the credit of special improvement district *492No. 27, gave his receipt therefor as such city treasurer, and by embezzlement of funds and manipulation of his books failed to have his books show the additional credit of $2,000. The contention that the city did not receive the funds is not entitled to serious consideration. If the $2,000 was not in the custody and possession of the municipality when it was regularly lodged in the possession of the city treasurer, what other act was necessary to perfect such custody? No other official or board had any legal right to receive or retain possession of city funds, and no other city official could be held responsible for the safekeeping of such funds.
Subdivision 1 of section 5034, Revised Codes 1921, defining the duties of a city treasurer, provides as follows: “ To receive all moneys that come to the city or town, either from taxation or otherwise, and to pay the same out on the warrant of the mayor, countersigned by the clerk, drawn in accordance with law.” That the $2,000 came into the possession of the municipality when it was regularly paid to its treasurer there can be no doubt, and it was the statutory duty of the treasurer to collect the taxes for special improvement district No. 27. (Sec. 5251, Rev. Codes 1921, as amended by Chapter 78, Laws 1929, sec. 1, subds. (a, b).)
In State ex rel. School District v. McGraw, 74 Mont. 152, 240 Pac. 812, 815, this court said: “There can be no question, then, but what school district funds and other funds of like character coming into the hands of the county treasurer in his official capacity, are ‘public moneys.’ ” We see no difference, in principle, between the McGraw Case and the case at bar. It is clear that the $2,000 that gave rise to this controversy came into the hands of the then city treasurer and that such amount was “public moneys” in the custody of the city of Red Lodge for the credit of special improvement district No. 27, and the city became the debtor of that district to that amount over and above the balance already in that fund.
After careful consideration of the record in this action and investigation of numerous authorities pertinent thereto, we have arrived at the conclusions which are now set down.
*493The office of the city treasurer is a continuing one, regardless of the person who may occupy it at any particular time, and the contention that the defendant in this action was not the person who held the office when the funds embezzled were received is not material. The city must answer for the illegal acts of its servants. (State ex rel. Titlow v. Centralia, 93 Wash. 401, 161 Pac. 74; People ex rel. Gibbons v. Coler, Comptroller, 41 App. Div. 463, 58 N. Y. Supp. 988; State ex rel. City of Cut Bank v. McNamer, 62 Mont. 490, 205 Pac. 951, 954.) The city, and not the treasurer, is liable to the bondholder here.
Defendant proceeds on the assumption that the defaulting city treasurer embezzled the particular $2,000 out of district No. 27. This is not correct. On one occasion Simmons received a check from the county treasurer for $10,687.96 in settlement of taxes collected by the county for the city; $6,996.39 was for the credit of district No. 27, but Simmons credited to district No. 27 $5,996.39 only, or $1,000 less than that fund should have been credited with. The check of $10,687.96 was not cashed and $1,000 taken out of the portion that belonged to district No. 27, but the check was deposited in the bank and placed to the credit of the city treasurer, increasing by that amount the city’s credit balance in the bank. The other $1,000 shortage came about in the same manner — the cheek received was not cashed but deposited in the bank to the credit of the city’s account. Obviously Simmons did not steal the particular money he received from the county for the credit of district 27. His peculations were no doubt carried on by his appropriating to his own use cash that was paid to him as city treasurer from time to time, and he used the account of district 27 for the purpose of covering up such peculations. It was not district 2'7’s funds taken but city funds, and district 27’s account was used as the embezzler’s shield. It would be useless to speculate as to what fund the money Simmons embezzled belonged to, and it is not material that that question be determined here, except to remove from the controversy the defendant’s assumptions that the $2,000 shortage was taken *494from the funds of district 27, and other city funds were not involved.
(e) Will mandamus lie against the present city treasurer to compel him to pay relator’s demand in the amount of $2,146.88 when a balance of $146.88 only is shown to the credit of district 27 f
“Mandamus lies only to compel the performance of a clear legal duty.” (State ex rel. Donlan v. Board of Commissioners, 49 Mont. 517, 143 Pac. 984, 985; State ex rel. Powell v. State Bank of Moore, 90 Mont. 539, 4 Pac. (2d) 717, 80 A. L. R. 1494.)
Mandamus is the proper remedy if the city treasurer may legally pay relator’s demand out of the balance in the treasury at the time demand was made (State v. McNamer, supra; State ex rel. Titlow v. City of Centralia, supra), but funds must be available which may be legally applied to meet the demand (People ex rel. Gibbons v. Coler, Comptroller, supra; Pippin v. State ex rel. Town of Blountstown, 73 Fla. 363, 74 So. 653; Nueces County Drainage District v. Garrett, County Treasurer, (Tex. Civ. App.) 202 S. W. 1000; State ex rel. City of Wolf Point v. McFarlan, County Treasurer, 78 Mont. 156, 252 Pac. 805).
On April 10, 1934, the relator demanded payment on his bonds in the amount involved in this action. On that date there was a balance in the city treasury of $4,784.55. Whether it would be legal to compel the payment of relator’s claim of $2,146.88 out of the city’s balance of $4,784.55, above referred to, such balance being made up of various other city funds in addition to the balance of $146.88 to the credit of district 27, is a question about which there are as many different views presented in adjudicated cases as there are eases reported.
The funds collected for district 27 were trust funds. (American Metal Ceiling Co. v. New Hyde Park Fire District, 91 Misc. 236, 154 N. Y. Supp. 661; State ex rel. Viking Tp. v. Mikkelson, supra; Municipal Bond Co. v. City of Riverside, 138 Cal. App. 267, 32 Pac. (2d) 661.) Where trust funds are *495mingled by the trustee with funds of his own, the entire mixed fund is impressed with the trust. (Yellowstone County v. First T. & s. Bank, 46 Mont. 439, 128 Pac. 596; State ex rel. Kelly v. Farmers’ State Bank, 54 Mont. 515, 172 Pac. 130.) This rule, however, has a limited application in the case at bar, as will be shown hereafter.
The case of State v. McNamer, supra, is more nearly comparable to the case at bar than any other decided by this court. There the court by mandamus directed the county treasurer to pay over to the city treasurer the full amount due the latter, regardless of the fact that the county treasurer had a large amount of funds tied up in a closed bank. The decision of the court in holding the county liable was largely based upon the fact that the county treasurer had been negligent in transmitting the money to which the city was entitled to the city treasurer. The court said: “But, says the defendant, the county treasurer has no available funds out of which to pay the amount due the city of Cut Bank. * * * Mandamus will not lie in the case at bar for the reason that the county treasurer, if required to pay the sum due the city, would have to take the money that was already appropriated to other funds. While we are fully aware of the rule that mandamus will not lie to compel the doing of something unauthorized by law or impossible of performance, yet in the instant case such a rule is inapplicable. In contemplation of law the city’s money is still in the county treasury, and the fact that the money has been diverted by the arbitrary act of the county treasurer into some other fund or funds does not excuse the treasurer from the duty of paying the same over to the city.”
In support of its ruling as above, the court cited, among others, the case of People v. Comptroller, 77 N. Y. 45, and quoted from the latter as follows: “It is a general rule that the writ of mandamus will not be awarded when it appears that there are no funds out of which the warrant can be paid if drawn. (High on Bemedies, see. 352.) But when money has been appropriated for a specific purpose it is not *496in all cases a sufficient answer to an application for a mandamus to compel its payment for that purpose to set up that the money, has been wrongfully applied to other purposes. It may be regarded in contemplation of law, as still in the treasury. (People v. Stout, 23 Barb. (N. Y.) 338, by Davis, J.; Hohl v. Town of Westford, 33 Wis. [323], 324; Campbell v. Polk County, 3 Iowa, 467; Lansing v. Van Gorder, 24 Mich. 456; Risley v. Smith, 64 N. Y. 576.) ”
The Michigan opinion just cited was delivered by Justice Cooley, and its logic has the usual appeal of pronouncements coming from that eminent jurist. Van Gorder contracted with the city of Lansing to grade one of its streets, the cost to be assessed to adjoining proprietors by special assessment. The assessment was levied, collected and paid over to the city treasurer. Van Gorder performed a large portion of the work, but the council, becoming dissatisfied with his progress, employed another to complete the work, and the payment to the latter nearly exhausted the special fund. Van Gorder sued the city. The court said: “The verdict of the jury settles the right of Van Gorder to be paid. The only question is, whether the city at large is liable to make the payment. * * * When the parties assessed have paid the tax levied upon them, they have performed their whole duty and discharged their entire liability. The duty then devolves upon the city, through its common council, to see that the money is properly applied. * * ® The jury having determined that Van Gorder was entitled to the "money in dispute, and the common council having ordered it to be paid over to another, the city is liable for the amount. The parties assessed cannot be-compelled to pay a second time, nor ought they to be. But Van Gorder was entitled to his pay from some source; and as the money raised for him has been misappropriated by a corporate act, the corporation must make it good to him.”
In the eases quoted from and in most of those cited here in which municipalities have been held liable for loss to a special *497or trust fund, when the loss occurred either by diversion by the municipality or through embezzlement of an official, the question of whether or not an order to pay claimant’s demand might encroach upon or deplete other trust funds was not fully gone into. We consider this question vital in the determination of the action at bar. Funds in the custody of a municipal functionary that may be disbursed for various purposes at the discretion of municipal officials are a general asset of the municipality, such as the general fund of a city which may be used to meet a demand such as we have in the instant case. A fund that is derived from a special levy or one created for a specific purpose is in the hands of municipal officials in trust. The municipality is merely a custodian, and its duties relative to such funds are purely ministerial, It may not use or divert them.
In the cases where payment has been ordered without qualification, we think the courts must have assumed that there were funds free from any trust relation in the custody of the municipality that could be legally applied to the payment of the. claims approved. Such assumption on the part of the court we think is obvious in State v. McNamer, supra, and eases there cited, as well as in all others we have reviewed.
That the relator has a right of action against the city in the instant ease there can be no question, but we do not think that the wrong suffered by the relator can be redressed in this action. The $4,784.55 in the city treasury of Red Lodge on April 10, 1934, when relator made his demand for payment of his bonds, represented the balance in sixteen different funds. District 27 had a balance of $146.88; the general fund balance was $533.22; practically all the other funds are trust funds which the city has no more legal right to divert than it would have to divert those of district 27, and to now attempt to remedy the situation presented here by taking a part of these other trust funds would be to commit an act equally as illegal as to take a part of the balance of district 27 and apply it to aid one of the other funds.
*498Reference has heretofore been made to the fact that the city of Red Lodge held the funds of district 27 as a trust fund. Public funds in the hands of public officials are all trust funds as a matter of course, but there is a distinction between funds that are raised by a special levy for a particular purpose, such as the funds of district 27 of the city of Red Lodge, and the general fund, which is levied for general purposes and may be expended at the discretion of the city authorities within the bounds of law for any purpose that the city authorities see fit, and, according to the authorities heretofore cited, if the city mingles such trust funds with its general and other funds of that nature, then the city must answer and reimburse the particular special fund that has suffered. But in all the cases we have studied there has been, in each, an assumption that funds were available which might be legally applied to meet the demand. Otherwise the demand was denied. (People ex rel. Gibbons v. Coler, Comptroller, supra; Pippin v. State ex rel. Town of Blountstown, supra; Nueces County Drainage District v. Garrett, County Treasurer, supra; State ex rel. Wolf Point v. McFarlan, County Treasurer, supra.)
There are cases which hold, and are fortified by sound reasoning, that one entitled to payment out of a special city fund may not be compelled to wait for the ordinary processes for raising revenue, but may compel a special levy to meet his demand. (See Hett v. City of Portsmouth, 73 N. H. 334, 61 Atl. 596, and Potter v. City of New Whatcom, 20 Wash. 589, 56 Pac. 394, 72 Am. St. Rep. 135.)
While we are satisfied that in a proper proceeding in which the city is made a party to the action the relator would be entitled to a judgment against the city, we are compelled under the decisions to hold that mandamus will not lie in this action, for the reason that there are not sufficient funds in the city treasury that may be legally applied to the- payment of relator’s claim.
*499The judgment appealed from is reversed, with direction to the district court to dismiss the proceeding.
Associate Justices Matthews, Anderson and Stewart concur.
Mr. Chief Justice Sands, being absent on account of illness, did not hear the argument and takes, no part in the above decision.