, Z. IlAIuRQADS. rigiitTo? way: •foreclosure of. I. The petition alleges that plaintiff executed and delivered upon the day of its date to the St. i «' Louis and Cedar Eapids Bailroad Company an -¡nstrumeilt in writing, of which the following is a copy:
“ I, Martin Yarner, for the consideration of one dollar to be paid me by the St. Louis and Cedar Eapids Eailway Company at any time within five years, do agree to grant to said company a right of way for said road over and across the southwest quarter of the northwest quarter and northwest quarter of southwest quarter of section 13, township 6Í), *678range 14; said right of way to be 50 feet in width on each side of the center line of said road, as now located; and I do authorize said company to enter upon said land, construct and operate said road, and this bond shall stand in lieu of a deed, which I do agree to execute to said company upon payment of said sum of one dollar, and ujwn the further condition that said company fence their road when completed, and give me the right to join said fence, and give me the use of all lands not used for the purpose of said i’oad, and a pass-way over said road on my premises for teams, etc.
“Martin Yarner.
“July 8, 1867.”
It is further averred that plaintiff was, and is still, the owner of the land described in the contract, and that the St. Louis and Cedar Eapids Eailway Co., and its lessees, the St. Louis, Kansas City and Northern Eailway Co., have, from the date of this contract, operated the railroad referred to in the instrument over the land, the last named company being, for a long time, in the exclusive use and control of the road, which it still possesses. Both of these corporations are named in the petition as the defehdants, and it is alleged that they have failed to perform the obligations expressed in the contract, whereby plaintiff has sustained damages to the amount of $1,000. Plaintiff prays that the defendant may be required to specifically perform the contract by constructing the fence and pass-way provided for therein, and that judgment be rendered for the amount of damages he has sustained. A deed for the right of way provided for in the contract is tendered by the petition. Service of ¡lotice was made upon the Si. Louis, Kansas City and Northern Eailway Co. January 31, 1876, and upon the St. Louis and Cedar Eapids Eailway Co. December 2d, 1878. On the 21st of February, 1876, the St. Louis, Kansas City and Northern Eailway Co. answered the petition, alleging that the St. Louis and Cedar Eapids Eailway Co., the other defendant, built the railroad referred to in the petition in 1866, and operated it until March, 1873, *679when, through the foreclosure of a mortgage and a sale thereunder, it was acquired by, and is still owned by, the St. Louis, Ottumwa and Iowa Eailway Oo. In 1872 the St. Louis, Kansas Oity and Missouri Eailway Oo. took possession of the road by parol license and continued to operate it until 1875, when it leased the railroad from the St. Louis, Ottumwa and Iowa Eailway Oo., and now operates it under the lease. The answer admits the execution of the contract, “but' denies all damages and submits to the court the question as to whether, under the facts herein contained, it is bound.”
May 1st, 1877, plaintiff filed an amended petition making the St. Louis, Ottumwa and Oedar Eapids Eailway Oo. a defendant, alleging that it owns and is operating the railroad referred to in the contract, which it acquired subject to the contract u]Don which this action is based.
May 3d, 1877, both of the railroad companies, being represented by counsel, assented to a decree requiring them to specifically perform the contract, which need not be particularly referred to here. An order is contained in the decree continuing the cause as to plaintiff’s claim for damages and transferring it to the law docket. This order was not assented to by defendants.
November 28th, 1877, the St. Louis, Ottumwa and Oedar Eapids Eailway Oo. answered plaintiff’s petition by adopting the answer of the St. Louis, Kansas Oity and Northern Eailway Oo., and on the same day the cause was tried to a jury, and certain special findings, as to the value of the fence and the damages srxstained by plaintiff, were made. The court refused to render a judgment upon the verdict of the jury, for the reason that neither of the defendants was a party to the contract sued upon.
On the 3d day of December, 1877, plaintiff filed an amended petition, praying that his vendor’s lien upon the road in Davis county should be established against all of the defendants, and for general relief. A motion to strike this petition *680was overruled. The cause was transferred by proper order back to the chancery docket.
On the 17th of June, 1879, the St. Louis and Cedar Rapids Railway Co., having before been served with notice, filed its answer, wherein it admits the contract as alleged in plaintiff’s petition, and that in 1868, with plaintiff’s consent, it entered upon the land and constructed the railroad, of which the defendant and its grantees, it is averred, “have been in actual adverse possession ever since; wherefore defendant says the action is barred by the statute of limitations.” The answer also sets up that before it was served with notice in this case all the conditions of the contract, as to the erection of a fence and a pass-way, had been complied with; it also denies all allegations of the petition not admitted in the answer. The case was tried by agreement upon the written evidence taken at the former trial. The court found that there is due plaintiff upon the contract $147, and judgment therefor is rendered against tbe St. Louis & Cedar Rapids Railway Co., and the judgment is declared to be a lien upon the railroad constructed upon plaintiff’s land, and the interest of the other railroads, defendants herein, is made inferior and subject to the judgment. The decree orders that an execution issue in 30 days, and the road located on plaintiff’s land be sold, and a general execution issue for any balance that may remain unpaid after such sale against the St. Louis and Cedar Rapids Railway Co. All the defendants unite in the appeal.
II. The case may, in our opinion, be more briefly and satisfactorily disposed of by considering the objections to the decree of the court below urged by defendants’ counsel. We will discuss them in an order different from that presented in counsel’s argument.
We do not think the defendants can complain of the refusal of the Circuit Court to render judgment upon the verdict of the jury. Indeed they do not complain thereof, but insist that it was error to try the case to the court while the verdict was not disposed of or set aside. We think the action *681of tlié court, in refusing to render judgment on the the verdict, sufficiently disposed of it. Surely defendants cannot complain on the ground that no judgment was rendered against them, and they had a new trial at which they could again present their defenses.
III. We think there was no error in permitting plaintiff to amend and make the St. Louis and Oedar Rapids Railway Go. a defendant. That corporation was a necessary party, and the question of damages could not have been determined unless it was made a defendant. In order to determine the amount of plaintiff’s claim, for which he is entitled to a foreclosure against the road of which the other defendants were lessees, or otherwise interested, the St. Louis and Cedar Rapids Railway Oo.-was a necessary party. The other defendants were necessary parties, as their property was to be affected by the judgment. This counsel admit in their argument. It was, therefore, proper to have all these corporations before the court upon the final trial. The motion to strike the amended petition was properly overruled.
IY. The court discovered, after the trial to the jury, that the whole case was cognizable in chancery. The question as to plaintiff’s right to foreclose the contract and establish his lien was dependent upon his right to recover a judgment;, the amount of the judgment it was competent for the court to determine as a court of chancery; the two branches, of the •case were properly triable together. The court did not err in transferring the case back to the chancery docket. If any error was committed it was in transferring the cause to the law docket. But of this the parties cannot complain. The error was cured by the court proceeding with the whole case as a chancery action.
Counsel for defendants deny that the cause was transferred again to the chancery docket. But we find the record shows such an order.
Y. Counsel object to the decree because it establishes and-enforces a lien upon a part, a section, of defendants’ railroad. *682The petition prays that plaintiff’s vendor’s lien may be established and enforced; it also prays for general relief. Whether plaintiff had or had not what is called a vendor's lien, we need not inquire. We think the decree is correct and enforces rights which plaintiff holds under the law. The court finds that there is due the plaintiff $14:7 upon the contract, and renders a judgment against the corporation with whom he made the contract. The judgment is made a lien upon the land described in the .contract occujned by the railroad, and is declared to be superior to the interest of the other defendants; the lien is to be enforced by the sale of the land. We will inquire whether this decree is supported by the pleadings and proof.
The agreement, which is the foundation of the action, is for the sale of land, and plaintiff is bound thereby to execute a deed upon the performance of certain conditions by the other parties. The defendant, the St. Louis and Cedar Rapids Railway Co., was the purchaser, and became bound to perform these conditions, which are the consideration for the land. The case and the remedy pursued are clearly within the following próvisions of the Code:
“ Sec. 3329. In cases where the vendor of real estate has given a bond or other writing to convey the same on payment of the purchase money, and such money or any part thereof remains unpaid after the day fixed for payment, whether time is or is not of the essence of the contract, such vendor may file his petition, asking the court to require the purchaser to perform his contract, or to 'foreclose and sell his interest in the property.
“Sec. 3330. The vender shall, in such cases, for the purpose of the foreclosure, be treated as a mortgagor of the property purchased, and his rights may be foreclosed in a similar manner.”
The vendor of real estate, and all persons holding under him, are proper parties to an action under these sections, which clearly authorize the relief granted by the decree of the court *683below in this case. If it be conceded that plaintiff is not entitled to what is called a “vendor's lien” he is entitled to a lien, and its enforcement, under these sections. See cases cited in Miller’s Code and McClain’s Statutes.
VI. The fact that the remedy of plaintiff is to be enforced by the sale of a part only, a section, of the defendants’ road, is no objection to the relief granted. The defendants having become bound to pay for the land, by the performance of the obligations they assumed, must hold the land subject to plaintiff’s rights. Because the land is used for railroad purposes, plaintiff’s rights are not different from what they would have been had he sold the land to a natural person for private purposes. A railroad company, entering upon land with the consent of the owner and constructing a railroad upon it, may be ejected upon failure to pay the consideration for the land. Conger v. The Burlington and Southwestern Railroad Co., 41 Iowa, 419. See also Richards v. The Des Moines Valley Railroad Co., 18 Iowa, 259, and Daniels v. The Chicago and Northwestern Railway Co., 35 Iowa, 129. And when a right of way is appropriated, with the assent of the owner, the railroad company will be enjoined from using it without making compensation to the owner, Hibbs v. Chicago and Southwestern Railway Co., 39 Iowa, 340. The law will not permit a railroad company to hold land for the use of its road without paying for it. The same principles which support this rule will authorize the railroad company to be dispossessed of the land by a judicial sale had in proceedings to enforce the landowner’s rights.
VII. As we have seen, the instrument, which is the founda■tion of the action, is a contract for the sale of land. Plaintiff undertook to give immediate possession, and convey the land upon the payment of one dollar, and upon further condition that defendant should fence the -road when completed, and give plaintiff the right to join the fence, and the use of all the land not used by defendant, and also construct a pass-' way over the railroad.
*684Tlie consideration plaintiff is to receive, under the contract, is one dollar and the benefit he will reap from the performance by the defendant of its contract to build the fence, etc. If defendant deprives plaintiff of these benefits by failure to perform its contract, the value thereof is the money consideration which plaintiff is entitled to receive, and which the law will award him. It is simply the case of the consideration of land being paid in some other thing than money. The plaintiff' is entitled to recover, by action, the value of the thing which constitutes the consideration. Now the law determines the value of the thing which defendant obligated itself to pay to plaintiff, by the direct and proximate benefits plaintiff would have derived from it had defendant rendered it to plaintiff at the time prescribed in the contract. In other words, the damages which the law will award to plaintiff for the breach of the contract is the money value of the consideration withheld from him. The court below admitted testimony showing the increase in the rental value of the land which would have occurred had the land been fenced. This, we think, is the direct and proximate damage sustained by plaintiff. Winne v. Kelley, 34 Iowa, 339.
VIII. Counsel for defendants insist that plaintiff’s measure of damages is the contract price of the fence and what it would have cost to build it. Rut what was the contract price? The building of the fence. Plaintiff in this view would be required to build the fence and sue defendant for the cost; that is, he would have to perform defendant’s part of the contract wholly, and would be entitled to recover the sum expended. This the law will not require; parties bound by a contract cannot escape from damages in this way. It is true that in cases where small outlays will secure the thing which a party to a contract obligates himself to furnish, the other party is required to make it and to do himself what the obligee ought to have done, rather than submit to loss and base a claim of damages thereon. But the law will not require an obligee to wholly perform a contract at a large out*685lay. In the case before us the cost of the fence would have been $400. Had plaintiff built it he could have recovered that sum and no more. The law will not permit parties in this way to escape the responsibility of doing what they contract to do, and impose such responsibility upon the parties with whom they contract.
IX. "We have carefully considered the evidence upon the subject of plaintiff’s damages, and think it fairly supports the finding of the court below. We do not think it ought to be disturbed, but adopt it as our finding in the case.
X. Plaintiff .presents a motion in this court to strike defendants’ amended abstract from the files, to strike the evidence from the bill of exceptions and to affirm the decree of the court below. This motion need not be passed upon in view of the fact that we affirm the judgment upon the merits of the case.
XI. Counsel for plaintiff, in their argument, complain that the amount of damages found by the court below is not enough. In view of the fact that they move to affirm the judgment they cannot be heard to urge this objection and ask for a decree awarding plaintiff a larger amount as damages.
The foregoing discussion disposes of all points in the case ai’gued by counsel. The decree of the Circuit Court is
Affirmed