delivered the opinion of the court.
This was an action brought by the plaintiff against the defendant to recover certain surplus funds alleged to have been received by the defendant on the sale of lands under a deed of trust. It appears by the petition that on the 31st day of January, 1857, one James Reid, Sr., conveyed certain real estate to defendant in trust to secure the payment of a debt therein named; that on the 2d day of April, 1859, the said Reid executed to defendant in trust a certain other deed to secure the payment of another debt therein specified; and that on the 9th day of September, 1859, said James Reid, Sr., conveyed by deed the same land to the plaintiff, James Reid, Jr., subject to-the two trust deeds above mentioned. Defendant accepted the trust, and, the notes not being paid at maturity, proceeded to sell the land to satisfy the debts respectively secured, and also the costs and expenses. Upon a sale the sum of three hundred dollars remained as' a surplus, after the payment of the debts and all costs, for which this suit was instituted. The defendant interposed a demurrer, on the sole ground that by law the plaintiff was not entitled to the surplus proceeds, which demurrer was sustained by the Circuit Court, and judgment given for defendant. This judgment was reversed *308in the District Court, and the cause is now brought here by writ of error.
The principal ground urged in this court for a reversal is, that there was no allegation in the petition that a demand was made for the money and that there was a refusal to pay previous to the bringing of the action. This question was not raised in the court below; but even were it available here, and admitting this to be a case in which a demand was necessary prior to the institution of the suit, still the party cannot take advantage of it unless he expressly set it up by way of defense in ,the answer or replication, and accompanies it with a tender of the amount due ; in -which case, if the plaintiff will further prosecute his suit, and does not recover a greater amount than is tendered, he shall pay all costs. (Gen. Stat. 1865. ch. 173, § 34; Westcott v. De Montreville, 30 Mo. 252.) This objection, therefore, cannot avail the defendant in this court.
The next question is, who was entitled to the surplus funds remaining in the hands of the trustee (defendant) after satisfaction was made of the debts and costs ? At the time of the sale Reid, Sr., had parted with all his interest in the land. He had conveyed his equity of redemption to the plaintiff in this cause, who held the whole title subject to the encumbrances arising out of the trust deeds. Had the plaintiff paid off and discharged the debts which the deeds of trust were given to secure, there is no doubt but that his title would have been perfect.
Where the property was sold under the deeds of trust for the payment of the notes, the surplus remaining over became subject, in the hands of the trustee, to a trust for the benefit of the party next entitled thereto. (Foster v. Porter, 37 Mo. 534.) The plaintiff, having acquired the equity of redemption, became substituted thereby to the place and light of Reid, Sr., the original grantor, and, as such, was entitled to receive that surplus in his stead.
It follows that no error was committed in the District Court, and its judgment is affirmed.
The other judges concur.