ON PETITION EOE EEHEAEINO.
Pee Cueiam.In the argument in support of the petition for rehearing our conclusion as to the proper construction of the original and first amended complaints has been questioned, but no reason has been presented which leads us in any way to modify the same. Neither at the original hearing nor at this time have we failed to comprehend the theory of the case as advanced by counsel for the appellant, but we do not cdnsider it tenable.
The only point sought to be made, worthy of serious consideration, is that this court has not jurisdiction upon this review. The argument is, since we determined that in the original and first amended complaints the cause of action was, or the causes of action were, for breach of contract, and the object was to recover damages, and the action was dismissed, there is present none of the elements which, under the statute, invoke the jurisdiction of this court.
Our jurisdiction does not depend upon what was contained *154in either one of the first two pleadings filed by plaintiff, and counsel clearly misapprehends the ground upon which it attaches. We said distinctly in the former opinion that plaintiff was not in a position to question the rulings of the trial court in sustaining demurrers to either of his first two pleadings, for the reason that by the filing of the first amended pleading he is conclusively deemed to have waived error, if any there was, in the order of the court sustaining the demurrer to the original complaint, and when he elected to file a second amended complaint when the court sustained a demurrer to the first amended complaint, he likewise abandoned the latter pleading.
We also said, and repeat, that when plaintiff tendered for filing, or filed, his second amended complaint, all former pleadings were as if they had not been filed, save only for the purposes of comparison, and we held that our examination of the former pleadings was made solely for the purpose of enabling us to determine whether the second amended complaint tendered for filing was proper in this action. We demonstrated, as we think, in the original opinion, that it was a clear departure from the former pleadings in that, while their object was to recover damages for a breach of contract, its object was to rescind the contract and recover possession of real estate. We deem it unnecessary to repeat the argument by which the conclusion was reached. It is only necessary now to say that the test of our jurisdiction upon this review is whether or not there is present in the case as made by the second amended complaint any of the elements which, by the statute, must be present in order to entitle the defeated party to a review in the supreme court of the judgment against him.
As to this there can be, and is, no question. The cause of action, as set forth in this last pleading of the plaintiff, clearly and confessedly involves a freehold, and it is from the judgment of the district court refusing to permit this complaint to be filed, or what is its equivalent, striking it from the files, and dismissing the action; that this appeal is *155prosecuted. A freehold being involved, our jurisdiction therefore exists, and having obtained jurisdiction of the cause we may, under repeated decisions of this court, dispose of all of the questions involved in the case which have been properly presented for decision.
Satisfied, as we are, from a careful examination of the record that in the second amended complaint there was a clear departure from the cause or causes of action theretofore relied upon, it should not have been filed over the objection of the defendant. It is quite immaterial what reasons the trial court gave for its rulings. If they were right and can be maintained for any reason, they should not be disturbed.
The petition for rehearing should be denied, and it is so ordered.
Rehearing denied.