The opinion of the court was delivered by
These three actions involve the same general state of facts and were consolidated in the court below. They are brought on the relation of the county attorney of Jefferson county, against the officers of Stonehouse Drainage District No. 1 of Jefferson county and the surety companies which were on the bond of the treasurer of the district and in each case the payee of a warrant paid by the county treasurer of Jefferson county that had been drawn on the special improvement fund of the drainage district by the officers of the drainage district. The plaintiff prevailed in each of the cases. All of the defendants have appealed. To avoid useless repetition reference will be made to the allegations in Case No. 36,334, wherein the state seeks to recover from Lawrence Richardson, an attorney at Topeka, and the other defendants, the amount paid him on a warrant drawn on the “special improvement fund” of the district for legal services.
After the formal allegations, the petition alleged that the drainage district had deposited with the county treasurer of Jefferson county the proceeds of the sale of bonds, which fund was designated as “special improvement fund” and that the officers of the district unlawfully issued to Richardson a warrant on this fund in the sum of $1,000, which was presented to and paid by the county treasurer of Jefferson county; that it was the duty of these officers to pay out of the general fund under the provisions of G. S. 1935, 24-428; that no part of the proceeds derived from the sale of bonds could be lawfully used for any other purpose than the payment of costs of special improvements, for which the bonds were issued; that the direction by the officers to pay and the payment of attorney fees to Richardson by the county treasurer out of the “special improvement fund” violated the provisions of that section and was without authority and unlawful and that this’ $1,000 thus unlawfully obtained by Richardson should be repaid to the county treasurer, together with interest, from the date of payment for the benefit of the special improvement fund. The petition then alleged the official capacity *182in which Sturm, Baker and Hoekstra had acted as officers and members of the board of directors of the district; that demand had been made upon all the defendants for repayment of the money unlawfully paid to Richardson and that they failed to pay it; that the action was brought in the name of the State of Kansas on the relation of the county attorney for the benefit of the drainage district.
The defendants filed separate demurrers to the petition in each one of these actions. The first ground was that the plaintiff had no legal capacity to sue. The second that the petition did not state a cause of action. Those demurrers were overruled. On appeal we affirmed the judgment of the district court. See State, ex rel., v. Baker, 156 Kan. 439, 134 P. 2d 386.
When the case again reached the district court the case was finally submitted and judgment entered for the plaintiff against all the defendants with the proviso that if the surety companies were compelled to pay any part of the judgment they should be subrogated to the rights of the plaintiff against the other defendants in the amount each company might be compelled to pay. All the defendants have appealed from that judgment.
The defendants each filed a motion to make R. W. Edmonds, former county treasurer, the American Surety Company his bondsmen, and the Stonehouse Drainage District No. 1 parties defendant. The motion pleaded that Edmonds had been the county treasurer at the time the warrants were paid and that it was his fault that they were paid out of the bond fund and on that account he and his bondsmen were liable to the plaintiff; that the Stonehouse Drainage District should be made a party because the defendants, Baker, Sturm and Ho.ekstra were its officers and the acts complained of in the petition were done by them as officers; that the warrant referred to in the plaintiff’s petition was for legal services rendered by the defendant named as payee,and the payment of this warrant out of the special improvement or bond fund was in payment of a debt due him on account of services rendered in good faith and the payment of it out of the bond fund served to enrich the general fund and to prevent circuity of litigation it was important that all of: these parties be named parties defendant so that all matters involved might be litigated in one suit. These motions were overruled in each of these cases and as to all defendants.
Thereupon the Maryland Casualty Company answered admitting the formal allegations and alleging that the final act of mis*183application of funds by payment out of the special improvement fund was the act of the county treasurer and on that account he was liable for the payment out of the bond fund; that the violation of the law for which defendant Baker was liable was that he failed to account for and pay to his successor the amount of the warrant, which was paid out of the special bond fund instead of the general fund; and that Baker did not convert any of the funds belonging to the district but did, however, turn over to his successor the total sum, representing all of the moneys which came into his hands less those which were actually due from the payees of the various warrants issued; that the district had not suffered any loss by reason of the issuance and payment of the warrants. The answer then alleged that the warrant paid to Richardson was for good and valuable consideration and in estimating the amount that would be necessary to make the proposed improvements the board acting in good faith included this and other items for legal and engineering services, believing that each of them was properly included in the estimated cost of the work; that when the warrant for $1,000 was issued and presented to the county treasurer the question of the propriety of paying it out of the special improvement fund was raised and the matter of payment was delayed until it could be submitted to the attorney general; that it was so presented and paid upon his advice. The answer then contained the following allegations and prayer:
“By reagon of the premises the said warrant was properly paid out of the special improvement or bond fund and no judgment should be entered against defendants herein. The issuance of said warrant and payment thereof was the joint act of the defendants Sturm, Hoekstra, Baker and Richardson and the county treasurer. If judgment be entered against any it should be against all of them. If by reason of its suretyship this defendant be compelled to pay any or all of such judgment it should be subrogated to the rights of the plaintiff against said defendants and each of them and against the Stonehouse Drainage District for services rendered by said Richardson to it. If and when the amount of this warrant has been repaid to the bond fund the District should then be ordered by the court to pay said amount into the general fund and warrant issued upon that fund to pay said amount to the person entitled thereto.
“Wherefore, this answering defendant prays that it may be hence dismissed with its costs, or in the alternative, that if judgment be entered against it by reason of having signed the bond of Ralph Baker as treasurer, it be subrogated to the rights of the plaintiff herein to recover by way of subrogation against its co-defendants, Ralph Baker, Kathryn Hoekstra, E. J. Sturm, Lawrence Richardson and The Stonehouse Drainage District, the county treasurer and his bondsman; that an order be issued to the Stonehouse Drainage Dis*184trict directing that if and when the amount of said warrant has been paid into said special improvement fund a like amount be paid from said fund into the general fund and á warrant for said amount be thereupon drawn upon said fund in favor of the person who has paid said amount into said special improvement fund.”
The answer of the Central Surety and Insurance Corporation was substantially the same.
Lawrence Richardson answered admitting the issuance of the warrant. He alleged he was an attorney and that the warrant was paid for professional services rendered by him to the drainage district and represented the fair and reasonable value thereof. The answer also alleged that in the event he be held liable, to the plaintiff he should be allowed by way of set-off the sum of $1,000 for professional services rendered. His prayer was for costs.
Ralph Baker answered admitting his membership on the board and issuance of the warrant. His answer also alleged that he, Sturm and Hoekstra obtained the advice of their attorney as to the legality of the payment of the warrant from the special improvement fund and were advised that it was legal; that they also obtained the opinion of the attorney general, a copy of which was attached to the answer, and he advised them that it was legal for them to make the payments out of the special fund. The answer further alleged that all of the acts of Baker, Hoekstra and Sturm were done in good faith. The prayer was for costs.
Sturm and Hoekstra answered to about the same effect.
In the other two cases the common defendants made approximately the same answers and so also did the payees of the warrants in each case. The case was tried and the parties entered into a stipulation of the facts as follows:
“1. All of the allegations set out in the respective petitions which are admitted by the respective answers of the defendants, the same as though set out herein.
“2. The plaintiff has made demand upon the defendants and each and all of them for repayment to the County Treasurer of Jefferson County, Kansas, of the amounts represented by the several warrants for the benefit of Stonehouse Drainage District. The defendants have failed, neglected and refused to pay the same, or any part thereof.
“3. Each and all of the warrants sued on herein were issued and paid in good faith out of the bond fund, for good and valuable consideration, for services which were in fact rendered by each of the respective payees for the benefit of the Stonehouse Drainage District in respect to the proposed improvements and issuance of bonds which were submitted to the taxpayers of said District and approved by them as provided by the statutes.
*185“4. In considering the matter of and in estimating the amount that would be necessary to make the proposed improvements and the amount of taxes and bonds required to be paid by them, the Board, acting in good faith included the attorneys’ fees in the sum of $1,000.00, engineering fees and other items, including $1,100 to H. L. Watchous, $705.50 to H. L. Watchous, $228.50 and $86.00 to O. J. Eidmann, for each and all of which amounts the respective parties rendered services, and the amounts charged were fair and reasonable and approved by the Board of Stonehouse Drainage District.
“5. Said amounts as above stated were actually included in the estimate of costs and were a part of the total amount for which taxes were paid and bonds issued for the payment of said proposed improvements, and were a part of the money which was actually raised by the payment of taxes and the sale of bonds so authorized by a vote of the voters, and became a part of the fund known as Special Improvement Fund or Bond Fund.
"6. When said warrant for $1,000.00 was issued and presented to the county treasurer for payment, the question of the propriety of paying the same out of said Special Improvement Fund was raised and the payment thereof was delayed until the matter could be submitted to the Attorney General of this state. Said matter was thereafter so presented to the Attorney General and upon advice of the Attorney General on or about the 28th day of November, 1939, the said warrant for $1,000.00 was paid by the treasurer out of said Special Improvement or Bond Fund. The Attorney General was told that the above items were included in the estimate of the cost of improvements and in the amount provided for by taxation and bonds. Thereupon he advised the Board as above stated. A copy of the letter of the Attorney General is as follows:
“With further reference to the bills of the engineer and attorney for the Stonehouse Drainage District No. 1, I feel that in view of the items of ‘contingencies’ in the engineer’s revised estimate of May 1*1, 1939, and the board’s resolution of October 23, 1939, the board may pay those bills.
“As stated in our previous correspondence on this matter, I think that your opinion is very well thought out, but that neither your office nor this office at that time was aware of the item hereinbefore mentioned, and that the board actually did contemplate the payment of attorneys’ and engineers’ fees from that item.
“7. The issuance of said warrant and the payment thereof was the joint act of the defendants, Sturm, Hoekstra, Baker, and the County Treasurer.
“8. After the advice of said Attorney General was given and acted upon in respect to said warrant for $1000.00, each and all of the other warrants sued on herein, to-wit: $1100.00 and $705.50 to H. L. Watchous, $228.50 and $86.00 to O. J. Eidmann, were paid pursuant to said advice of the Attorney General.
“9. The bond given by the defendant, Central Surety & Insurance Corporation of Kansas City, Missouri, dated March 1st, 1940, for the sum of $5,000.00 with the defendant, Ralph Baker, as principal, was furnished at the request of said Ralph Baker, and the said Ralph Baker and M. B. Lodge, attorney in fact for the Central Surety & Insurance Corporation would testify that the said Baker applied for a bond for one year, that a premium for only one year was paid for said bond.”
*186At the trial Ralph Baker was the only witness. He testified that he had been elected director of the district for three years but after he had been elected director he was elected by the other directors as treasurer each year, that is, on March 1, 1938, and on March 1, 1939, but he gave a bond for each of those years and that in giving this bond he attempted to and intended to give only a statutory bond. At the end of this testimony counsel for each of the bonding companies asked the court to reform the bond to conform with the intention of the parties to the effect that it was only a statutory bond and was not intended to be a bond for faithful performance as well as one to account for money. The court did not rule directly upon that motion but said it would be taken under consideration along with other matters.
The court found in favor of the plaintiff against all of the defendants in each of the cases for the amounts for which suit was brought. The judgment was that in the Richardson case the plaintiff recover from the defendants the sum of $1,295, with interest thereon.
The judgment contained the following:
“It is further by the court considered, ordered, adjudged and decreed that the said defendants, the Maryland Casualty Company and Central Surety and Insurance Corporation, be and they are hereby subrogated to the rights of the judgment rendered herein in favor of said plaintiff and against said defendants to the extent and in the respective amount that each company may be compelled to and does pay. to said plaintiff in satisfaction of said judgment, and that execution or executions issue therefor.”
The judgment in the other two cases was to the same general effect.
The defendants filed a motion for a new trial on the ground of erroneous rulings of the court, that the decision was contrary to the evidence, and that judgment should have been entered in favor of the defendants and against the plaintiff. These motions were all overruled. The specifications of error are that the court erred in overruling the motion filed by each of the defendants to make additional parties defendant; in overruling the motion made by each of the surety companies to reform the bond; and in entering judgment for plaintiff and against all the defendants; and in overruling all the motions for a new trial.
The question of the liability of the defendants was settled by the conclusion reached in State, ex rel. v. Baker, supra. Nothing pleaded *187in the answers or established by the stipulation as to facts changed this liability.
There remains, however, the question of the rights of all the parties to the action as to each other which was raised by the motions and answers and dealt with in the stipulation as to the facts.
The district was organized under G. S. 1935, 24-401, and following sections. G. S. 1935, 24-407 sets out the powers of the district. The eleventh subdivision of that section reads as .follows:
“To annually levy and collect a general tax not exceeding five mills on the dollar on all taxable property within the district, to create a general fund.”
The twelfth and thirteenth subdivisions of the section provide as follows:
“To levy assessments and special taxes, if deemed expedient by the directors, upon all of the real estate in the district that may be benefited, to defray the costs of the construction and maintenance of levees .or other works or improvements to prevent the overflow of natural watercourses, or the drainage of overflowed lands therein, or that may be conducive to the public health, convenience, or welfare.
“To issue negotiable bonds to pay the cost of widening, deepening and otherwise improving the channels and constructing embankments, drains, levees and other works along the banks of natural watercourses, to pay for the purchase or condemnation of land necessary therefor, to prevent overflow and protect the property situated within the district from damage and injury thereby; such bonds to be payable by general taxation of all property within the district when it shall be determined that all property situated within'the district will be benefited thereby or that such work or improvement is necessary, or will be conducive to the public health, convenience or welfare, and beneficial to all the inhabitants of such district: Provided, That no such bonds shall be issued until authorized by a vote of the taxpayers, as hereinafter provided.”
It should be noted that other sections provide for a determination by the board of directors of whether work should be paid for by levying special taxes or by the sale of bonds.
G. S. 1935, 24-428, provides as follows:
“The compensation of the directors, assessors, engineers and attorneys employed by the board of directors shall be paid out of the general fund herein-before authorized.”
It will be seen that the three statutes first quoted above provide, first, for the creation of a general fund by the levy of a general tax of not to exceed five mills on the dollar upon all taxable property in the district, and for the levying of special taxes upon real estate in the district or for the issuance of bonds for the purpose of carrying *188on the actual work for which the district was created, that is, improving channels, construction of embankments, drains, levees, etc., while the last section quoted provides that the compensation of the directors, assessors, engineers and attorneys employed by the board be paid out of the general fund for which a tax of not to exceed five mills on the dollar might be levied on all taxable property.
As was stated in State, ex rel., v. Baker, this action was brought by the state on the relation of the county attorney because the members of the board of directors of the district had violated the above statute by paying the compensation of the payees in the warrants in question out of a fund designated “special improvement fund,” being proceeds from the sale of certain bonds issued for the construction of alleged improvements in said district. We have the warrants before us now. It appears that it was sometimes referred to as the “special fund,” and sometimes as the “bond fund.”
The statute makes it the duty of the county treasurer of the county in which the district is situated to receive, safely keep and pay out-funds belonging to the district. It also provides that the purchase price of all bonds sold by the board of directors for cash shall be paid directly to the county treasurer and he shall retain them and all taxes, special assessments and other funds received by him until paid out on written orders of the board of directors. (G. S. 1935, 24-415.)
It is clear from the record in this case that the county treasurer did receive the proceeds from the sale of bonds and set up a fund from these proceeds on his records.
The stipulation as to the facts stated that this fund was also augmented by receipts from taxes. Whether this means taxes raised b3¡r means of a general levy on all property in the district, as provided in subdivision 11 of G. S. 1935, 24-407, is not as clear as we would like it to be. However, the stipulation does say that the attorney general was told that the above items were included in the estimate of costs and improvements apd in the amount provided for by taxation and bonds.
The appellants argue that this fund, known as the special improvement fund, was augmented by the payment of taxes and that statement is not disputed by counsel for appellee. At any rate, there was a fund known as a “special improvement” or “bond fund” carried on his record by the county treasurer. The warrants with which we are concerned were paid out of that fund and we held that it was *189a violation of G. S. 1935, 24-428, to do so. See State, ex rel., v. Baker, supra.
Now as to the equities' in this case. It will be noted that the action was brought by the state on the relation of the county attorney of Jefferson county. This is a form of action resorted to occasionally when it appears that public officials have not performed their duties properly. The leading case on the subject is State, ex rel., v. Bradbury, 123 Kan. 495, 256 Pac. 149. In that case the state on the relation of the attorney general and the county attorney of Labette county brought an action to compel a board of education to sue its members in their own proper person because they had wrongfully expended money belonging to the district. We pointed out the anomalous situation the case created, that is, the prayer really asked that the board members be directed to sue themselves and denied the writ although we had previously held in another action that the money had been wrongfully expended. We pointed out, however, that the relief sought could be had in an action maintained by the state on the relation of the attorney general and county attorney. This sort of action is provided for by G. S. 1935, 19-702. In State ex rel., v. Baker, supra, we again reviewed the authorities and adhered to the views expressed in State, ex rel., v. Bradbury, supra.
The petition in each of these cases alleges that the action is brought for the benefit of the drainage district. It was nowhere al'leged that there was any corruption or bad faith in the payment of money involved, only that it was paid out of the bond fund when it should have been paid out of the general fund.
The stipulation as to the facts states that the warrants were paid in good faith for services rendered and that the amounts charged were fair and reasonable.
The defendants asked that the district be made a party defendant so that all matters involved might be adjudicated in this action. This motion was overruled by the trial court. This motion might well have been sustained. We do not, however, consider that failure of the trial court to sustain it prevents us on appeal from directing a judgment which accords with our idea of equity between all parties concerned. While the Stonehouse district is not an actual party to the case, as we have pointed out, the action is brought for its benefit so for all practical purposes it is here as much as though it had formally been made an actual party.
The trial court gave judgment against all the defendants, that is, *190the two surety companies, each member of the drainage board and the payee of each separate check. It provided further that if the surety companies were obliged to pay the judgment they were subrogated to the rights of plaintiff against the defendants to the extent that each company might be compelled to pay the judgment. If that judgment as rendered be allowed to stand when the companies pay the judgment and the special bond fund is thereby replenished by the amount of it, the surety companies will be compelled to first seek to recover .the amount which each had paid from the members of the board as they personally are able to pay and finally from the payee of the check.
' The result of this judgment would be that the drainage district would be enriched by the amount of the judgment no matter in what fund it be held and would have received its engineering and legal services free of charge. This is not an equitable result and does not conform to our ideas of justice. It will not do to say that the surety company should pay and then try to recover from the board members or the payees. If they should finally accomplish this end it would be after vexatious litigation and the drainage district still would have received its legal and engineering services free of charge. The provision in the drainage act, G. S. 1935, 24-428, did not contemplate any such a result. The provision providing for a levy of five mills on all taxable property in the district to pay such bills was enacted by the legislature with the idea that such a levy would be made and the bills paid. Subrogation is an equitable doctrine. It is called into play to see that all parties receive equitable consideration. We hold that the judgment in these cases should be modified so as to provide that the Maryland Casualty Company and the Central Surety and Insurance Corporation shall have judgment against the drainage district in the amount each is compelled to pay in satisfaction of the judgment on the bonds. The drainage district is ordered to pay this judgment to the Maryland Casualty Company and the Central Surety and Insurance Corporation out of any funds it may now have in its general fund. If it does not have sufficient funds in its general fund to pay this judgment it is ordered to make a levy of five mills on the dollar on all taxable property in the district until it has raised sufficient money to pay it.
As so modified, the judgments’ are affirmed.