This is an appeal from an order of the circuit court of Jerauld county, sustaining a demurrer to the answer of defendant, in an action wherein the plaintiff sought to recover a certain- sum as commissions, in a transaction involving an exchange of lands in this state for -other lands in the state of Illinois. Appellant contends that -the answer demurred to sets up facts which show that the cause of action alleged in the complaint has become res judicata, and therefore the plaintiff cannot recover in- this action. We do no-t deem it necessary to set out the pleadings in full, because a brief statement of the facts will serve to make clear the grounds of appellant’s contention. A former trial of this action was had in the circuit, court on issues raised by the pleadings as they then stood. From a verdict and judgment in favor of plaintiff, and an order overruling a motion for a new trial, defendant appealed to this court, where a reversal was had,' and the cause remanded for a new trial.
The opinion of the court is found in 21 S. D. 183, 110 N. W. 774. As appears therefrom, the ground of the reversal was a fatal variance between the allegations of the original complaint and the evidence. In brief the allegation of the complaint was .that the commissions were earned by a sale of the land through plaintiff’s services, while the evidence disclosed an exchange of *425defendant’s lands for other lands in Illinois. On the return of the cause to the circuit court the plaintiff asked and was granted leave to amend the complaint to conform to the evidence given on the trial, by alleging that the commissions claimed were earned in services rendered by plaintiff in procuring an exchange of defendant’s lands for other lands in Illinois. Thereupon the defendant filed the answer now before us, which recites in full the proceedings had on the former trial and subsequent thereto, and appellant alleges in the answer demurred to, and now contends : “That interpretation and decision of the agreements and rights of the parties to said transaction have become and are res judicata and binding on the plaintiff, and that the plaintiff is now precluded from any recovery in his action, except upon pleading and proof conforming to and supporting the said interpretation and decision of said Supreme Court, and particularly this defendant alleges that the plaintiff, by said allegation and proof on former trial, and by said interpretation and decision of said Supreme Court, is now estopped and forever barred from any claim or right to recover in this action-on allegations and proof of any agreement wherein the plaintiff was to receive a commission of $2 per acre for negotiating the exchange of the lands, regardless of whether the lands received by defendant were of 'sufficient value to make a consideration to this defendant in excess of $14 per acre for his said land.” In his brief appellant’s counsel says: “In this case plaintiffs first alleged that the land was sold under a contract by which they were to receive as commissions the excess over $14 an acre, and on the -trial offered proof and recovered a verdict on that version of the contract. The plaintiff, now seeks to recover on an alleged agreement to pay $2 an acre, regardless of the amount per acre received for the land. This is a new contract, and not within the prior pleadings and proofs.”
An examination of the evidence contained in the abstract on the former appeal shows that the actual contract between the parties related to an exchange of defendant’s land for other lands in Illinois, and that defendant fixed a net price of $14 per acre on his lands, and agreed that for the purposes of the exchange his lands were to be valued at -$x6 per acre, the Illinois lands *426being valued at $45 per acre, and that for such services the plaintiff should receive $2 per acre of defendant’s lands. It thus appears, as held by this court on the former appeal, that the contract proved constituted a fatal variance from the allegations of the complaint, and a new trial was awarded for that reason alone. The allegations of the amended complaint are strictly in accordance with the proof at the former trial. The contract as stated by Corson, J., in the former opinion of this court was: “That said defendant as party of the first part ‘sold to the parties of the second part the following described real estate * * * price $16 per acre. Parties of the first part agree to accept as part payment for same land, and the parties of the second part agree to give as part payment for said land the following described land. * * * Price of this land to be $45 per acre.’ It will be noticed that by this contract the price per acre of the tracts of land of the respective parties was definitely fixed, and the trial court seems to have taken the view that the contract was in effect a sale of the lands by the defendant, and hence there was no variance between the allegations of the complaint and the proof.”
In construing ,t'he contract as alleged, in the, original complaint it is there said: “The plaintiff’s by the terms of their contract with the defendant, as alleged in their 'complaint, were to receive $2 per acre if defendant received for his land $16 per acre, or the amount per acre in excess of $14 in case defendant did not receive $16 per acre. It was competent for the defendant to show the value of the Illinois farm, in order that the jury might determine from the evidence whether or not the defendant had in fact received more than $14 per acre for his Dakota lands. If, as a matter of fact, the Illinois farm was not worth $45 per acre, then the defendant did not receive $16 per acre in value for his Dakota lands, and the plaintiffs would not be entitled, in any event, to recover under the terms pf their alleged contract an amount in excess of the actual difference in the value of the Illinois farm and the $14 per acre for defendant’s Dakota lands. In excluding this evidence, therefore, the court was in error.” Under the contract, alleged in the complaint, the court was clearly *427right in, holding that the exclusion of evidence as to the value of the Illinois land was erroneous. But the court does not hold that the exclusion of such' evidence wou-ld have been erroneous it the contract actually shown by the evidence as above stated had been property pleaded in the complaint. The real gist of appellant’s contention, however, seems to' be that respondent in his original complaint, having erroneously stated the terms and conditions of his contract, as shown by his evidence, is now estopped from setting up in an amended complaint the true terms and conditions thereof. The decision cited by appellant, affirming the rule stated in Wright v. Lee, 10 S. D. 263, 72 N. W. 895, go no- further than to- hold that a decision of this court upon appeal becomes the law of the case on a subsequent appeal. In the former decision of this court there was an adjudication of the rights of the parties under the contract as pleaded, but there was no such adjudication of their rights under the contract which was shown by the evidence.
In the case of Child v. McClosky, 14 S. D. 181, 84 N. W. 769, there was held to be an adjudication where the rights of the parties had been determined under the evidence submitted on a former trial, and the evidence received upon the trial of a new action, involving the same rights, was substantially the same. 1 fere there has been no adjudication of the rights of the parties under the contract shown by the evidence. Appellant’s counsel in his brief, referring to the contract set out in the amended complaint, says,“This is ,a new contract, and not within the prior pleadings and proof.” It is difficult to see how, under this view of the case, counsel can contend that the former decision of this court can be held to be an adjudication of the rights of the parties. The only effect of the former decision- of this court was to grant a new trial and remand the action for further proceedings according to law. If such amendment of the complaint could have been allowed before the trial, no reason is apparent why the same amendment might not be' permitted by the trial court after a new trial was granted by this court. In the case of Schnepper v. Whiting, 18 S. D. 40, 99 N. W. 85, this court -said: “These objects will, we believe, be best attained by holding -that the re*428versal of a judgment without other direction, places the parties in the same position they occupied before the case was tried.” Such seems to be the general holding of the courts. State v. Stull, 2 Neb. (Unof.) 385, 96 N. W. 121; State v. Dis. Court, 91 Minn. 161, 97 N. W. 581; Ill. State Trust Co. v. St. Louis, etc., Railway Co., 217 Ill. 504, 75 N. E. 562; Hollingsworth v. Barrett, 102 S. W. 330, 31 Ky. Law. Rep. 428; Fugate v. Gill, 99 S. W. 602, 30 Ky. Law. Rep. 731; Rush v. Rush, 170 Ill. 623, 48 N. K. 990; Lang v. Metzger, 206 Ill. 475, 69 N. E. 493-497.
In the case of Selbie v. Graham, 18 S. D. 376, 100 N. W. 758, this court said: “If the claim or cause of action now interposed by Graham was 'not within the allegations of his complaint in the former suit, and such is the law of that case, it necessarily follows that we 'are not now dealing with the same claim' or cause of action, and that the former judgment operates as an estoppel only as to- such issues as were actually litigated and determined in the former action. * * * Had. this court been dealing with a decision containing the facts established by the evidence — had it been dealing with the merits of the controversy in- place of a mere question of procedure — the result might have been different. In any event, the effect of an affirmance would have been decidedly different. Substance should never be sacrificed to form. When avoidable, the enforcement of substantial rights should not be defeated by mere technicalities or the mistakes of counsel. It now clearly appears that a state of facts exists which entitles Graham to substantial relief, that the same state of facts was shown to exist on the former trial, and that he was denied relief, not for the want of proven facts, but because of insufficient pleading.”
We are not entirely clear whether appellant means to- urge the former decision of this court as res judicata, or is- claiming that because the respondent in his amended complaint pleads a contract differing somewhat in its terms from -that contained in his original ■ complaint,' lie is. estopped ■ by his former pleading. The doctrine of election of remedies, discussed in certain authorities cited in appellant’s brief, has no application to- the facts in this' record, and needs no discussion upon this appeal.
*429On both propositions discusséd, and in any view of the facts, we are convinced that appellant is in error in his contention, and that the order appealed from should be affirmed.