This action was brought by* the plaintiff Ulness, trustee in bankruptcy of the Magic Grain Dump Company, a domestic corporation, against the directors and stockholders of said corporation, to recover from them certain dividends alleged to have *98been paid, out of tbe capital stock of tbe corporation. In tbe complaint it is alleged in substance that tbe plaintiff is tbe duly appointed, qualified and acting trustee in bankruptcy of said Magic Grain Dump' Company, a .bankrupt, and brings tbis action as sucb trustee; that said Magic Grain Dump Company is a corporation organized and extising under tbe laws of tbe state of North Dakota with an authorized capital stock of $100,000.00; that tbe corporation was organized for tbe purpose of manufacturing and installing grain dumps, known as “Magic Grain Dumps,” in grain elevators; that tbe manufacture and distribution of sucb “grain dumps” was covered by patents issued by the United States of America and by tbe Dominion of Canada, which patents were tbe property of tbe corporation; that at alb times involved in tbis action, the defendants Harry Knapp, Wm. Dunnell, J. E. Harmon, Ered Ernst, W. G. Hancock, Ira Hush and- Jack Adams, constituted tbe Board of Directors of said corporation and bad exclusive management thereof; that all tbe defendants named in tbe title of tbis action were owners of certain shares of capital stock in tbe corporation (tbe number of shares owned by each of said persons being specifically alleged in tbe complaint) ; that practically tbe sole assets of tbe corporation consisted of tbe patents above referred to; that on or about July 14, 1928 tbe said company sold its Canadian patents and received therefor $16,243.18 in cash; that tbe amount so received represented and constituted capital assets of said corporation and did not constitute profits or earnings; that on or about said 14th day of July, 1928, tbe defendants last above named, acting as tbe Board of Directors of said corporation, under tbe guise of declaring a twenty-eight per cent dividend on tbe capital stock of said corporation, distributed to tbe stockholders out of the moneys received from tbe sale of tbe Canadian patents tbe sum of $13,924.00 (tbe specific amounts received by each of tbe several stockholders being stated). It is further alleged that at tbe time of sucb distribution there were outstanding debts of the-corporation aggregating to exceed $15,000.00.; that tbe total assets-of tbe corporation after sucb distribution do not exceed $500.00 and that tbe corporation is wholly unable to pay or discharge any of its indebtedness. It is further alleged that tbe purported declaration and distribution of dividends was unlawful and in violation of tbe duties of tbe directors, and was merely a scheme to cheat and defraud the-*99corporation and its creditors. There is attached to the complaint an itemized statement of the claims of the different creditors showing-outstanding debts to exceed $15,000.00. The defendants demurred to the complaint on the grounds: (1) That there is a defect of parties defendant; (2) That several causes of action have been improperly united; (3) That the complaint does not state facts sufficient to constitute a cause of action.
The demurrer was overruled and the defendants have appealed.
1. The first ground of the demurrer, that there is a defect of parties defendant, is clearly untenable. The basis of this ground of demurrer, as pressed by the appellants, is that too many persons are named as parties defendant. But “a defect of parties, plaintiff or defendant” (Comp. Laws 1913, § 7442) means a deficiency of parties and has no application to a case of too many parties, or the joining of persons who have no interest in the litigation. Mader v. Plano Mfg. Co. 17 S. D. 553, 97 N. W. 843; Olson v. Shirley, 12 N. D. 106, 96 N. W. 297. “The defendant cannot demur upon the ground that there are too many plaintiffs or defendants, but may do so if the petition shows that otters should be joined. It must be a defect and not a misjoinder.” “A defect of parties for which a demurrer is allowed is a deficiency,'and not an excess, of parties.” Olson v. Shirley, supra.
2. Does the complaint state facts sufficient to constitute a 'cause of action? The question must be answered in the affirmative. The demurrer in this case was interposed by all the defendants jointly, hence, the trial court was correct in overruling the demurrer if the complaint stated a cause of action as to any of the defendants, even though it failed to state a cause of action as to others. Dalrymple v. Security Loan & T. Co. 9 N. D. 306, 83 N. W. 245; 49 C. J. p. 428; Pom. Code Rem. (5th ed.) p. 16.
We are of the opinion, however, that the complaint in this case states a cause of action against all of the defendants. According to the allegations of the complaint all the defendants were and are stockholders in the Magic Crain Dump Company and received the alleged dividend. Some of the defendants were also directors who declared and caused such alleged dividend to be paid to the several stockholders, including themselves. It is a well-settled principle that a dividend cannot rightly be declared by a corporation except out of the profits *100earned by it: 6 Fletcher, Cyc. Corp. pp. 6209, et seq.; Fricke v. Angemeier, 53 Ind. App. 140, 101 N. E. 321.
In this state that principle is embodied in statute. (Sections 4543, 4544, Supplement to the Compiled Laws of 1913.)
“The directors of corporations must not make dividends except from the surplus profits arising from the business thereof; nor must they divide, withdraw or pay to the stockholders, or any of them, any part of the capital stock. . . (Section 4543, Supplement, to the Compiled Laws of 1913.)
“The directors under whose administration the same may have happened, except those who may have caused their dissent therefrom to be entered at large on the minutes of the directors at the time, or were not present when the same did happen, are in their individual and private capacity, jointly and severally liable to the corporation, and to the creditors thereof, in the event of its dissolution, to the full amount of the capital stock so divided, withdrawn, paid out, or reduced, or debt contracted. . . (Section 4544, Supplement to th.e Compiled Laws of 1913).
According to the allegations of the complaint the dividends paid over to and received by the different stockholders constituted practically all the property of the corporation and rendered the corporation wholly insolvent. While there is a conflict in the authorities as to whether an action will lie against a stockholder to recover a dividend paid out of the capital stock of a solvent corporation where the stockholder received the dividend in good faith, believing it to be paid out of the ■profits (Lark Equity Exch. v. Jones, 42 N. D. 145, 149, 171 N. W. 863), the authorities are all agreed that stockholders have no right to retain money received by them for dividends paid out of the capital stock of an insolvent corporation (6 Fletcher, Cyc. Corp. pp. 6209, 6215; 7 R C. L. p. 285; Powers v. Heggie, 268 Mass. 233, 167 N. E. 314). Such moneys may be recovered from the stockholders who have received them by the corporation (6 Fletcher, Cyc. Corp. pp. 6209, et seq.), or by the trustee in bankruptcy of such corporation. 6 Fletcher, Cyc. Corp. pp. 6211, 6212; Cottrell v. Albany Card & Paper Mfg. Co. 142 App. Div. 148, 126 N. Y. Supp. 1070; Powers v. Heggie, 268 Mass. 233, 167 N. E. 314, supra; Mackall v. Pocock, 136 Minn. 8, L.R.A.1917C, 390, 161 N. W. 228; Fricke v. Angemeier, 53 Ind. *101App. 140, 101 N. E. 321, supra; Miley v. Heaney, 168 Wis. 58, 169 N. W. 64; Breon v. Ford, 182 Wis. 616, 197 N. W. 195.
Tbe trustee in bankruptcy succeeded not only to tbe bankrupt’s title to property and to contractual and statutory rights of action existing in favor of tbe bankrupt corporation (Bankruptcy Act, § 70a U.S.C. title 11, § 110(a); 2 Collier, Bankr. 13th ed. p. 724; 4 Remington Bankr. 3d ed. §§ 1402, et seq.) ; but, according to tbe provisions of tbe Bankruptcy Act, “such trustee, as to all property in tbe custody, or coming into tbe custody, of tbe bankruptcy court shall be deemed vested with all tbe rights, remedies and powers of a- creditor bolding a lien by legal or equitable proceedings thereon; and also, as to all property not in tbe custody of tbe bankruptcy court, shall be deemed vested with all tbe rights, remedies and powers of a judgment creditor bolding an execution duly returned unsatisfied.” (Bankruptcy Act, § 47a (2), U.S.C. title 11, § 75(a) (2).
We are wholly agreed that tbe facts stated in the complaint here show tbe payment of a dividend in circumstances creating a liability to tbe corporation on tbe part of tbe stockholders receiving tbe same and also a liability to tbe corporation under §§ 4543, 4544, Supplement to the Compiled Laws of 1913, on tbe part of tbe directors who declared and caused tbe dividend to be paid. As said, tbe right of action against tbe stockholders for sucb dividends is vested in tbe trustee in bankruptcy. This is also true of tbe right of action against tbe directors (Cox v. Leahy, 209 App. Div. 313, 204 N. Y. Supp. 741; Powers v. Heggie, 268 Mass. 233, 167 N. E. 314, supra. See also Appleton v. American Malting Co. 65 N. J. Eq. 375, 54 Atl. 454; Stolz v. Scott, 23 Idaho, 104, 129 Pac. 340; Brenaman v. Whitehouse, 85 Wash. 355, 148 Pac. 24). And it was tbe duty of tbe trustee to enforce sucb rights. 2 Collier, Bankr. 13th ed. p. 724; 4 Remington, Bankr. 3d ed. §§ 1402, et seq. Tbe statutory liability of tbe directors does not exonerate the stockholders. Powers v. Heggie, 268 Mass. 233, 167 N. E. 314, supra). Neither does tbe liability of tbe stockholders exonerate tbe directors. Hodde v. Nobbe, 204 Mo. App. 109, 231 S. W. 130. A party vested with right of action against both stockholders and directors might proceed to enforce eithér right of action; or be might institute actions to enforce both liabilities at tbe same time. Williams v. Brewster, 117 Wis. 370, 93 N. W. 482.
*102' Appellants contend, however, that tbe liabilities are’ separate and distinct; that tbe right of action against tbe stockholders is equitable in its nature and must be enforced in equity, while that against the directors is legal and enforcible by an ordinary action at law, and that consequently these causes of action may not be joined and enforced in one suit. In our opinion this contention is not well founded.
“The plaintiff may unite in the same complaint several causes of action, whether they are such as have been heretofore denominated legal or equitable, or both, where they all arise out of: 1. The same transaction, or transactions connected with the same subject of action; . . . But the causes of action so united must all belong to one of these classes and, except in actions for the foreclosure of mortgages, must affect all the parties to the action, and does not require different places of trial, and must be separately stated.” (Comp. Laws 1913, § 7466).
“Any person may be made a defendant who has or claims an interest in the controversy adverse to the plaintiff or who is a necessary party to a complete determination or settlement of the questions involved therein. . . .” (Comp. Laws 1913, § 7404).
“Whenever any creditor of a corporation shall seek to charge the directors, trustees or other officers or stockholders thereof on account of any liability created by law, he may commence -and maintain an action for that purpose in the district court and may at his election join the corporation in such action.” (Comp. Laws 1913, § 7997).
■ The provision in § 7466, supra, to the effect that the causes of actions to be united (except in actions for the foreclosure of mortgages) must affect all the parties to the action, does not mean that the parties must be affected equally or in the same manner. Pom. Code Rem. 5th ed. § 374; Stark County v. Mischel, 33 N. D. 432, 156 N. W. 931. See also Royer v. Rasmussen, 34 N. D. 428, 158 N. W. 988. Under these statutory provisions “it is no objection to the joinder of causes of action that they concern separate primary rights, for however numerous may l?e minor transactions, each constituting a primary right enforceable by the proper remedy, so long as they all reach back to the point of union as the parent cause thereof they all arise out of one ‘transaction’ and may be vindicated together, regardless of the form of remedy req*103•uisite as to each, provided they affect all the parties and do not require different places of trial. Causes of action arising out of the •same transaction which may be joined under the rules above stated include legal and equitable causes; also causes ex contractu and ex delicto.” 1 R. C. L. p. 363.
In Williams v. Brewster, 117 Wis. 370, 93 N. W. 479, the supreme court of Wisconsin had under consideration the precise question involved here, namely, the joinder of an action to enforce the liability against stockholders for an illegal dividend with one against the directors for the statutory liability arising by reason of the declaration and payment of such dividend. The statutes involved were quite similar to those quoted above. The arguments advanced by the' appellants in the Wisconsin case were strikingly similar to the ones advanced here. There, as here, it was urged that the liability of the directors was properly enforcible only at law, and the liability of the stockholders properly enforcible by suit in equity. The Wisconsin court, in a well considered opinion, disposed of these contentions adversely to the appellants and held that the liabilities of the stockholders and directors were so connected with each other and so “germane to the main purpose of the litigation” as to be enforceable in one suit. In 'the opinion in that case the court said:
“That there are some embarrassments attending the administration of snch complicated matters as may under our system be presented to a court for adjudication in a single decree, must be admitted. But the facility with which the court may lay hold of and draw together, as a single controversy, a dominant matter _ and everything germane thereto, regardless of complexities of legal and equitable rights and the number of parties, and weigh out to each person his legitimate measure of relief, regardless of his mere location on the record as a party, doing the work by one broad, comprehensive decree, that might, under a different system, require a multitude of actions, or proceedings in their nature so interminable as to be exhausting to courts and litigants and the public as well, and do it better, vindicates the wisdom of the framers of the Code in embodying therein the valuable features of equity jurisprudence as it exists by the common law.” Williams v. Brewster, 117 Wis. 370, 93 N. W. 482.
The ruling of the Wisconsin court meets with our entire approval, *104and isj we think, a'proper construction of the statutes relating to joinder of causes. These statutes were enacted to expedite the administration of justice and were intended to enable separate primary rights, however numerous, “so long as they all reach back to the point of union as the parent cause” to be vindicated together regardless of tbs form of remedy requisite as to each, provided they affect all the parties and do not require different places of trial. 1 R. C. L. p. 163. Such statutes should be liberally construed so as to carry into effect the object sought to be accomplished thereby to the end that unnecessary litigation may be avoided. 47 C. J. 72.
It is urged by the appellants that no cause of action comes into being against the directors under §§ 7543, 7544, supra, unless and until the corporation has been dissolved either by judgment or by expiration of the terms of its corporate existence. In support of this contention appellants cite Topeka Paper Co. v. Oklahoma Pub. Co. 7 Okla. 220, 54 Pac. 455. We find it unnecessary to determine which is the correct rule, — the one announced by the Oklahoma court in the case cited (see also Stevirmac Oil & Gas Co. v. Smith [D. C.] 259 Fed. 650), or the one announced by the Supreme Court of Idaho (Stoltz v. Scott, 23 Idaho, 104, 129 Pac. 340, supra) to the effect that a corporation is dissolved within the meaning of this statute when the corporation ceases to do business because of its insolvency and is put into the hands of a receiver. The Oklahoma case relied upon by the appellant was one instituted by a creditor to enforce the statutory liability against the directors. This action is brought by -the trustee in bankruptcy. Under the express provisions of the, statute (§ 4544, supra) á cause of action comes into being in favor of the corporation itself against the directors who pay dividends in contravention of the statute. The trustee in bankruptcy succeeded to this.right of action of the corporation in this case and it was his duty, as well as his right, to institute an action, to enforce the cause of action which existed in favor of the bankrupt and Ip which he succeeded upon his appointment and qualification as trustee. . ' .....
■ It follows from what has been, said that the order appealed from is correct and must be affirmed. . It is so orderéd. , ,
Bubice, .Bibdzbll, Nuessle, and Burnt, JJ.,.concur.