— Respondent’s complaint contained three causes of action. The third cause of action is not before *535us. Respondent failing to recover thereon took no cross-appeal.
In his first cause of action, respondent Henry J. Radermacher alleged among other things that the district court in and for Gooding County on September 3, 1937, made and entered a judgment in an action between respondent and his wife, Freda Radermacher, awarding all real and personal property, hereinafter referred to and set out in respondent’s complaint, to Freda Radermacher; that respondent appealed to this court, and thereafter on December 7, 1937, Freda Radermacher entered into a written lease with appellant wherein she leased to him for a period of five years whatever interest she then had in said property, or had acquired by reason of the judgment of the trial court heretofore referred to, or that should be given or awarded to her in the final determination of the litigation then pending between her and respondent; that appellant agreed in said lease to abide by the result of said litigation; that respondent, after learning of the making of said lease, notified appellant of the pendency of said appeal, and that he would look to him for the rental value of said property in case he, respondent, should prevail in said appeal. It is also alleged that this court modified the judgment heretofore referred to by striking therefrom the provisions awarding the property therein described to Freda Radermacher, and by directing the district court to enter a new decree. (Radermacher v. Radermacher, 59 Idaho 716, 87 Pac. 2d 461.) Whereupon the trial court entered a new decree in which it again awarded certain property to Freda Radermacher. From this latter decree, respondent again appealed to this court whereupon it was again held that the trial court had no authority to ratify the sale of personal property which Freda Radermacher did, in the interim, make to appellant, and directed the trial court to enter a decree in accordance with the latter opinion. (Radermacher v. Radermacher, 61 Idaho, 261, 275, 100 Pac. 2d 955.) On July 27, 1940, the trial court again amended its decree by striking therefrom that part of the decree awarding the property in controversy to Freda Radermacher. Respondent further alleged that he was and is the owner of certain per*536sonal property and an undivided three-fourths interest in the real estate in controversy; that the reasonable annual rental value of his interest in the personal and real property was and is $1350, for the recovery of which, and by reason of the use and occupancy thereof by appellant during the years 1938 and 1939, he sought to recover $2700 less $324.70 paid thereon.
For his second cause of action, respondent alleged among other things that on January 7,1938, Freda Radermacher sold to appellant eighteen horses for the sum of $300; that said horses were part of the property awarded by the trial court to Freda Radermacher in the action heretofore referred to, and which this court directed be returned to respondent; that after the entering of the judgment on July 27, 1940, respondent demanded possession of said horses plus their increase from appellant and was refused, whereupon respondent sought to recover the alleged value of the horses, $1500, in case they could not be redelivered to him.
The cause was tried to the court and jury resulting in a judgment in respondent’s favor of $1200, the reasonable rental value of the land, and for return of the horses sold by Freda Radermacher to appellant or in lieu thereof, $300, from which judgment and from an order denying a new trial, this appeal is prosecuted. Such of the numerous assignments of error, being 33 in number, as we deem material will be considered.
Briefly, respondent seeks to recover possession of the real property heretofore referred to and certain farming equipment, the rental value of the real property and the farming equipment, and the personal property in controversy or its value if it cannot be returned. Since respondent is now and for some time has been in possession of the real property and the equipment, the determination of the question of such possession has become moot.
Directing attention to appellant’s third point, namely, that “the court erred in rendering and entering judgment against the appellant for the reason that the same is against law in this: A. This is a proceeding for restitution which should have been brought in the Supreme Court of *537Idaho and not in the District Court (Section 11-220,1. C. A.) B. Under the statute (Section 11-220, I. C. A.) the action could only have been brought against Mrs. Radermacher, and was not properly brought against Mr. Eckert, a mere tenant of Mrs. Radermacher * * * . C. If the lease to Mr. Eckert was void, his possession was that of Mrs. Radermacher, and this action is wholly unlawful and will support no judgment.”
To support the foregoing contention, appellant relies primarily upon sec., 11-220, I. C. A.:
“When the judgment or order is reversed or modified the appellate court may make complete restitution of all property and rights lost by the erroneous judgment or order, so far as the restitution is consistent with the protection of a purchaser of property at a sale ordered by the judgment, or had under process issued upon the judgment on the appeal from which the proceedings were not stayed; and for relief in such cases the appellant may have his action against the respondent enforcing the judgment for the proceeds of the sale of the property, * * (Italics ours.)
Undoubtedly in a proper case the supreme court may order restitution, or order the district court to make restitution, or an independent action may be brought as in the instant case. Under a statute identical with sec., 11-220, supra., (Revised Codes of Mont., 1921, sec. 9752.) the supreme court of Montana in Burgess v. Lasby, 94 Mont. 534, 24 Pac. 2d 147, 153, used the following language:
“The cases are legion which hold under an identical statute that the court may, in case the order appealed from is reversed, either compel restitution by its own mandate or direct that the lower court do so, or the plaintiff may maintain a separate action for that purpose.” (Nepstad v. East Chicago Oil Ass’n., 96 Mont., 177 29 Pac. 2d 643; State v. Grinde, 96 Mont. 608, 32 Pac. 2d 15.)
The rule is stated in 5 C. J. S. 1545, that: “The right of restitution may be enforced by proper order of the appellate court, summary proceedings in the lower court in the same cause, or by an independent action or suit.” To same effect see Moore v. Boise Land & Orchard Co., 34 Idaho *53850, 198 Pac. 753; Oatman v. Hampton, 43 Idaho 675, 693, 256 Pac. 529; 3 Am. Jur. 746; To the point that an independent action lies against appellant although not a party to the suit, see Berthold-Jennings Lumber Co. v. St. Louis, etc., Co., 80 Fed. 2d 32, 40, and cases cited therein.
We find no merit in the contention that if the lease to appellant was void, his possession was that of Freda Radermacher. Appellant’s possession and right of possession under the terms of the lease were commensurate with those of Freda Radermacher. By the district court’s decree awarding all of the property, including the separate property of respondent and the community property of respondent and Freda Radermacher, which was reversed, appellant acquired no title to the personal property, or interest or right to the possession of the real property from Freda Radermacher, since she had no such interest as she could convey; and appellant specifically by written agreement limited his interest in the property both real and personal to that of Freda Radermacher.
Appellant contends that when the lease and bill of sale were entered into, the trial court’s judgment was in full force and eifect; that under and by virtue of.said judgment, Freda Radermacher had authority to execute a valid lease and bill of sale; that the bill of sale so executed and the delivery of the personal property conveyed good title to appellant; that the execution of the lease and delivery of possession of the real property to appellant constituted a valid lease, and both agreements were in full force and eifect.
Freda Radermacher was without authority to make a valid lease, or to sell the personal property. The lease and bill of sale entered into by reason of the trial court’s judgment depended for their validity upon the judgment being sustained. Under the provisions of sec., 12-606, I. C. A., the action was still pending, no final determination on appeal having been made. The judgment was final in so far as it involved the trial court’s judgment but was not a final determination of the rights of the parties. It was held in Decatur v. Simpson, 119 Iowa 488, 93 N. W. 496, 97 Am. St. Rep. 328:
“While it is true that an appeal does not operate to *539stay the enforcement of a money judgment, no supersedeas bond being given, still it is equally true that an execution issued upon such judgment, and all proceedings had thereunder, are dependent for their validity upon the judgment being sustained. If property has been taken under such execution, restitution must be made. * * * * The judgment which alone authorized the garnishment, being erroneous, all proceedings had thereunder are, as between the immediate parties, ipso facto void and of no effect. * * * * The garnishment had vitality only through the judgment upon which it was predicated. When the judgment became extinguished, the garnishment, which was but an incident to it, partook of its fate, and the right of the judgment defendant to have restitution made became absolute eo instanti.”
Upon reversal of the trial court’s decree, appellant, having theretofore received benefits, became liable to respondent in restitution for such benefits. This is particularly true by reason of the fact that appellant specifically agreed in writing that his rights should be only such as Freda Radermacher’s rights might finally be determined. As was said by Justice Cardoza, in Gold Clothes Shop v. Lowe’s Buffalo Theaters, 236 N. Y. 465, 141 N. E. 917, where rights were sought to be established during the pendency of an action in which, as in the instant case, monies had been expended and benefits received upon the assumption that the judgment, subsequently reversed, was valid and effective:
“We are told that the defendant rested upon an order of a court. The prop was insecure, and warning was not lacking of the danger of collapse. When the order was reversed and the proceeding dismissed, rights and duties were re-established, inter-parties, as if no order had been made.”
Appellant was not a bona fide purchaser of the personal property, neither did he enter into the lease without full knowledge of all the facts both orally communicated and by public records. He therefore had notice and was charged with notice. In such circumstances the rule would seem to be that the right to restitution exists against those who are parties to the suit and also “third *540persons receiving the .money or property who are not bona fide purchasers.” (5 C. J. S. 1543; to same effect see, Hubbard v. Ogden, 22 Kan. 671; Di Nola v. Allison, 143 Cal. 106, 76 Pac. 976; Kremer v. Schutz, 82 Kan. 175, 107 Pac. 780; Packner v. Hoppas, 119 Kan. 415, 239 Pac. 967; Rumsey v. Rumsey, 150 Kan. 49, 90 Pac. 2d 1093; Arnold v. Joines, 50 Okla. 4, 150 Pac. 130.) In the last case it was held that a third party who purchased from a party to the suit was in privity of estate with the party litigant and equally bound with the party litigant. Appellant knew that the first judgment might be reversed, as it was upon appeal, and when reversed respondent was absolutely entitled to both the real and personal property; it was incumbent upon appellant to make complete restitution. In other words appellant became liable for the reasonable rental value of the real estate during his possession and for the value of the personal property such as he could not return.
Appellant takes the position, if we understand him correctly, that since respondent did not furnish a supersedeas bond on appeal, he is not in a position to question the validity of the lease or the sale of the personal property. In Kremer v. Schutz, supra, we find the following language which is, we think, directly in point:
“While the judgment of the district court awarding the land to John L. Kremer was what is termed a final judgment, it was subject to appeal, and an appeal was, in fact, taken from the judgment before the lease was executed. In contracting for the use of the land on the basis of that judgment, Schütz was bound to know that it was subject to appeal, and that an appeal had been taken. The litigation had not ended in the rendition of the judgment, and, although it may have seemed to Schütz that Mr. Kramer might ultimately win, he still took the risk of a reversal and of the final outcome of the litigation. * * * * In Martin v. Abbott, 72 Neb. 89, 100 N. W. 142, the appellant purchased land from the prevailing party in action for dower while an appeal was pending in a higher court. No supersedeas bond was given, and appellant claimed that he had acquired a good title to the land, and was not affected by the appeal or its result. *541The court held that he was a purchaser pendente lite, and that the absence of a supersedeas bond did not affect his standing. It was said that the case was quite unlike one where a party had obtained title at a judicial sale under a judgment of a court, but that, “when Love bought the premises pending an appeal, he took the same with his eyes open. He obtained the title clothed with no greater rights than his grantor, and took the same subject to the contingency of an adverse decision in this court.” [citing cases.] So here the tenant accepted a lease from and paid his money to Mr. Kremer with his eyes open, knowing that the ownership of the farm was still in litigation, and that whether he acquired any rights under his lease from Mr. Kremer depended upon the result of the appeal which had been taken when the lease was made. The real owner cannot be deprived of compensation for the use of her land because the tenant happened to deal with one who had no title in or right to lease the land.” (See MacKenzie v. Englehard & Sons Co., 266 U. S. 131, 69 L. Ed. 205, 45 S. Ct. 68, 36 A. L. R. 416.)
Appellant urges that the first and second causes of action were improperly joined. This point was not raised in the original demurrer filed to respondent’s complaint; however, nine days prior to trial of the cause, appellant unsuccessfully sought permission from the court to amend his demurrer in order to raise the question. Respondent,to support the court’s ruling, advances two propositions. First, that both causes of action were predicated on the same facts and proof of one substantially established the other. Second, under sec., 5-905, I. C. A., it is within the reasonable discretion of the trial court to permit or deny amendments to pleadings. Discretionary power means sound and impartial discretion. (Hamilton v. Hamilton, 21 Idaho 672, 123 Pac. 630.) We are of the opinion that the court did not err in this respect. First, under sec. 5-606, I. C. A., the causes of action were not improperly joined since they arose out of the same transaction. Second, “ * * * that the allowance of amendments at the trial is in the discretion of the court; * * * and will not be revised or disturbed, except for manifest abuse thereof.” (1 Bancroft Pleading, section 538; section 5-905, *542supra.) The latter rule has been followed in this jurisdiction.
“Granting or refusing to grant permission to amend a pleading is largely a matter of discretion of the trial court, and unless the exercise of such discretion deprives a party to the action of some substantial right, it is not error.” (Cady v. Keller, 28 Idaho 368, 154 Pac. 629.)
In Hoy v. Anderson, 39 Idaho 430, 435, 227 Pac. 1058, it is held: “Appellant has not pointed out and it is not apparent to us that he was prejudiced in his defense by the filing of the amended complaint.” Neither has appellant herein pointed out in what respect, if at all, he was prejudiced, or denied any substantial right, by the court’s action in refusing to allow the amendment to the demurrer. In view of all the facts and circumstances disclosed by the record, the trial court did not abuse its discretion in denying the amendment; no prejudice resulted to appellant by reason thereof.
Coming now to respondent’s second cause of action, in which he alleged:
“That on the 7th day of January, 1938, the plaintiff was the owner of and entitled to the possession of the following described property [Then follows a description of 18 horses.].
“That on the 3rd day of September, 1937, in an action then pending in the District Court in and for Gooding County, entitled Henry J. Radermacher v. Freda Radermacher, the said district court entered its decree by the terms of which it was provided in substance that Freda Radermacher was awarded as her sole and separate property all of the property of said Henry J. Radermacher including the livestock hereinbefore set out, said decree in substance empowered said Freda Radermacher to sell and dispose of the same;
“That' * * * on the 7th day of January, 1938 and while said action was pending upon appeal. * * * [appellant] .well knowing that said cause was pending on appeal to the Supreme Court made a purported purchase of the livestock, aforesaid from the defendant Freda Radermacher, taking a bill of sale in writing of said property, *543said bill of sale being executed by said Freda Radermacher for an alleged consideration of $300.00, and * * * that said bill of sale * * * contained in substance a reference to said decree of September 3rd, 1938, * * * the further stipulation * * * * that the said defendant was purchasing only such interest in the property as said Freda Radermacher should be awarded in the final decree in said action, and that he would stand to and abide by the terms of the decree; that the said defendant Amos Eckert is now in possession of said bill of sale, and that for that reason this plaintiff is unable to attach a copy hereto as an exhibit.
“That * * * on the 27th day of July, 1940, this plaintiff demanded of and from the said defendant Amos Eckert immediate possession of the livestock herein described; that the defendant then and there failed and refused to deliver said livestock * * * ; and that the plaintiff is entitled to the immediate possession of said livestock and increase therefrom, and if the same cannot be delivered in specie, then for the reasonable worth and value of said livestock in the sum of $1500.00.”
The bill of sale recites a consideration of $300 for eight head of horses described therein as having been sold and delivered to appellant. The court instructed the jury upon this phase of the case as follows:
“The plaintiff alleges that on the 7th day of January, 1938, the said Freda Radermacher sold to the defendant, Amos Eckert, fifteen horses therein described, for the sum of $300.00; that said horses were the property of the plaintiff and were part of the property which the District Court had awarded to Freda Radermacher in the action hereinbefore referred to, and which property the Supreme Court ordered restored to Henry J. Radermacher, as hereinbefore recited with reference to the land, and that after the entry of the judgment of July 27, 1940, the plaintiff demanded possession of said horses and their increase, from the defendant Eckert, which demand the defendant refused; wherefore, plaintiff asks for the return *544of said livestock and their increase, or if the same cannot be redelivered to him, that he have judgment for their reasonable value which he alleges to be $1500.00.”
“* * * the plaintiff seeks to recover the horses which the evidence shows the defendant bought from Freda Radermacher during the time the appeal from the judgment in the case of Radermacher v. Radermacher, was pending in the Supreme Court, or, if recovery of said horses cannot be had, then that he be given judgment for their value; that is, the plaintiff asks for the return of the specific horses, but if the same cannot be returned, then that he have judgment for their value.”
The verdict of the jury contains the following recital: “Under the second cause of action we find the plaintiff [respondent] * * * is entitled to recover the horses which defendant bought from Freda Radermacher and further find that the value of said horses at the time and place when and where they were taken or received by the defendant, was $300.00.”
The complaint alleged the sale to appellant on January 7, 1938, by Freda Radermacher of eighteen horses for the sum of $300. The judgment recited that respondent was entitled to receive seventeen horses plus their increase or $300. The bill of sale stated specifically that Freda Radermacher sold to appellant eight horses. The record shows that possibly all but two of the horses listed in the bill of sale can be returned, and that the horses not included in the bill of sale are either in respondent’s possession or on his ranch, and were never claimed by appellant. From an examination of the record it would appear that there were but seven horses and their increase to which appellant claimed title. The other horses being kept on the ranch and fed and cared for, but never claimed, by appellant.
We find no support in the record which will sustain the court’s júdgment that respondent have returned to him seventeen horses and their increase, or $300. We are confronted with the question, how and in what way the value of the horses not returned can be ascertained. *545If appellant returns all of the horses except two, upon what theory could he be held liable for $800? (sec., 11-220,1. C. A.)
Sec. 11-220, supra, which provides that the court may make complete restitution of all property lost by an erroneous judgment so far as restitution is consistent with protection of a purchaser of property, would seem to require that a finding be made by the court or jury of the number of horses actually sold by Freda Radermacher to appellant, their increase, the value of the horses returned and the value of the horses that appellant was unable to return, and enter judgment accordingly. It must be kept in mind that this is an action in restitution and respondent is only entitled to have restored to him the property lost to him by reason of the erroneous judgment, and consistent with his second cause of action and the proof offered in support thereof.
The horse referred to as the “Wilson horse” was not one of the horses attempted to be sold by Freda Radermacher, or an increase. The jury by its verdict found “That the plaintiff [respondent] * * * is entitled to recover the horses which defendant bought from Freda Radermacher” but did not find that respondent was entitled to recover the “Wilson horse” or its value. The trial court however in its judgment awarded the “Wilson horse” to respondent contrary to the verdict of the jury. We think this was error.
No prejudicial error appearing in the record that would justify a reversal of the judgment as to the first cause of action, the same is affirmed. As to the second cause of action, the judgment must be reversed for the reasons herein stated and a new trial granted. Each party to pay one-half of all taxable costs.
Givens, C. J., Morgan, Holden, and Ailshie, JJ., concur.