
677 P.2d 490 (1984)
106 Idaho 177
Victor M. THOMPSON and Grace M. Thompson, husband and wife, Plaintiffs-Respondents.
v.
William L. KIRSCH and Marcia Kirsch, husband and wife, Defendants-Appellants, and
Darlene M. Morgan, a single woman, Defendant, and
Pioneer Title Company of Ada County, an Idaho corporation, Defendant.
No. 14201.
Court of Appeals of Idaho.
February 14, 1984.
*491 Charles W. Hosack, Coeur d'Alene, for defendants-appellants.
Paul L. Westberg of Nelson & Westberg, Boise, for plaintiffs-respondents.
SWANSTROM, Judge.
William and Marcia Kirsch have appealed from a deficiency judgment entered against them when Victor and Grace Thompson foreclosed a second deed of trust. The issues in this case are whether it was proper for the district court to enter a deficiency judgment and, if so, whether the court properly calculated the amount of the judgment. We hold that the district court properly awarded a deficiency judgment, but we remand for a recalculation of the amount.
In the spring of 1979, Darlene Morgan, who is not a party to this appeal, desired to purchase a Boise home owned by the Thompsons. This property was encumbered by a first deed of trust, the beneficiary of which was Lomas & Nettleton Co. (L & N), a Connecticut firm. The sale occurred on May 8, 1979. To finance the purchase Morgan paid the Thompsons $5,000 in cash and assumed the existing deed of trust in the amount of $30,936.79. Morgan paid the remainder of the $59,500 sale price and closing costs by executing a promissory note in favor of the Thompsons for $23,664.55 (the Thompson note). To secure payment of this note, Morgan executed a deed of trust naming the Thompsons as beneficiaries. William Kirsch also signed the Thompson note, and  although he was not a co-purchaser of the property  he signed the deed of trust. The note called for the entire principal, together with interest of 12% per annum, to be paid by May 8, 1980.
The monthly payments on the first deed of trust were $362. After making three installments, Morgan stopped making any *492 payments. As a result, on March 20, 1980 the Thompsons' attorney sent a letter notifying Kirsch that the L & N note was nine payments in arrears and informing him that by signing the Thompsons' deed of trust he had agreed "to pay ... when due, all encumbrances, charges and liens, with interest, on said property or any part thereof, which appear to be prior or superior hereto." The letter also informed him of his obligation to pay the Thompson note and threatened legal action if he failed to perform his responsibilities. On June 2, 1980 the Thompsons, having received no funds from Kirsch in payment of either their note or the L & N note, filed this suit against Mr. and Mrs. Kirsch. In the meantime Morgan had filed for bankruptcy in the U.S. Bankruptcy Court. That court discharged her obligation under the Thompson note and released her real property from its jurisdiction.
By May of 1980 the L & N note was in arrears by ten payments totaling $3,620, plus late charges of $238. To protect their interest in the property, the Thompsons paid the past due sum of $3,858.30. Thereafter the Thompsons continued making the payments to L & N. The Thompsons also advanced money to pay for insurance, power, sewer, water, and maintenance of the house and yard. In addition, they paid for an appraisal and a foreclosure title report. This lawsuit followed.
After the parties filed their stipulation of facts, the district court handed down a memorandum decision and on March 11, 1981 a decree of foreclosure was entered. The decree awarded the Thompsons the amount they claimed as principal and interest on the Thompson note. It also awarded them the sums they had advanced to preserve their interest in the property. As part of this amount, the court included the attorney fees they had incurred in the lawsuit. To enforce its decree, the court directed the Ada County Sheriff to sell the property for cash at a public sale. To avoid the delay and expense of an actual sale, the parties stipulated that the property would be deemed "sold" by sheriff's sale on April 1, 1981 to the Thompsons for its fair market value of $57,000, the amount set by an appraisal. The Thompsons "paid" this sale price by assuming the then-existing balance of the L & N debt of $29,369.39 and by giving the Kirsches a credit of $27,630.61 against their mortgage indebtedness. This left a deficiency judgment of approximately $14,700, which we explain more fully in Part II of this opinion, for which the Thompsons received a judgment against the Kirsches.

I
The Kirsches' first contention in this appeal is that a proper application of I.C. § 45-1512 does not permit the entry of any deficiency judgment. This section, part of the act governing trust deeds, imposes limits on the amount of a deficiency judgment.
However, Idaho Code § 45-1503 provides that, at the option of the beneficiary, a deed of trust may be foreclosed "by advertisement and sale" as provided for in Chapter 15 of Title 45, or "by foreclosure as provided by law for the foreclosure of mortgages of real property," commonly referred to as judicial foreclosure. In respect to the latter, I.C. § 6-101 provides in part that "[t]here can be but one action for the recovery of any debt, or the enforcement of any right secured by mortgage upon real estate which action must be in accordance with the provisions of this chapter." It is apparent from the record that the Thompsons opted for judicial foreclosure. The court determined the amount of the deficiency judgment by proceeding under I.C. § 6-108, rather than under I.C. § 45-1512. Its choice of laws was correct.
We next review the procedure applied by the district court in calculating the amount of the deficiency judgment under I.C. § 6-108. That section also contains a limitation upon deficiency judgments. It provides:
No court in the state of Idaho shall have jurisdiction to enter a deficiency judgment in any case involving a foreclosure of a mortgage on real property in any amount greater than the difference between *493 the mortgage indebtedness, as determined by the decree, plus costs of foreclosure and sale, and the reasonable value of the mortgaged property, to be determined by the court in the decree upon the taking of evidence of such value.
Here, the district court determined that the "reasonable value" of the mortgaged property was $27,630.61, a figure reached by subtracting the amount owing on the first deed of trust from the fair market value on the property. This was the amount credited to the Kirsches in the parties' stipulation pertaining to the sheriff's sale and was the effective sale price of the property. By subtracting the "reasonable value" of the property from the "mortgage indebtedness," as calculated by the court, the court determined that there was a deficiency of $14,704.31. The addition of costs made the total deficiency judgment $14,797.92.
In reviewing whether the overall approach taken by the district judge was correct we must first determine what is meant by "reasonable value" as used in § 6-108. The district judge obviously gave it a meaning different from "fair market value," because he found that the fair market value was $57,000, based upon the parties' stipulation. In Eastern Idaho Production Credit Association v. Placerton, Inc., 100 Idaho 863, 606 P.2d 967 (1980), the Idaho Supreme Court stated:
[Idaho Code § 6-108] was added by the Idaho legislature in 1933 to afford greater protection to the large numbers of debtors facing the prospect of defaulting on their mortgage debts. The statute substitutes the fair market value of the property for the price at foreclosure sale as the amount to be deducted from the debt in order to fix the amount of the deficiency judgment. And it requires the district court to take the necessary evidence to determine the value of the property. [Emphasis added.]
Id. at 869, 606 P.2d at 973.
In that case, Eastern Idaho, a junior mortgagee, had acquired title to the mortgaged property of Placerton by redeeming it from foreclosure of prior mortgages and by purchasing the property at a sheriff's sale after another prior mortgage was foreclosed. The total consideration paid by Eastern Idaho was less than the fair market value of the property. Since it already had title to Placerton's property (via purchase at the sheriff's sale), Eastern Idaho convinced the trial court that there was no need for it to go through a foreclosure action on its own mortgage. Eastern Idaho merely proved what Placerton owed and a judgment was entered for that amount. Placerton appealed. The Idaho Supreme Court held that, in effect, Eastern Idaho had "appropriated" the security without giving Placerton the benefit of the property's fair market value as a credit against Placerton's debt to Eastern Idaho. The court held that Eastern Idaho had profited by the difference between the fair market value and the amount Eastern Idaho had paid to acquire title. The Supreme Court remanded so the trial court could recompute the amount of Eastern Idaho's "deficiency judgment."
In the factual context of the Eastern Idaho case, "reasonable value" as used in I.C. § 6-108 would necessarily be construed to be the same as "fair market value." Using "fair market value" to set the limit on the deficiency judgment of the junior mortgagee did not result in disregarding the amounts of the mortgage indebtedness of the prior mortgages. Nor do we find any holding in Eastern Idaho which would require us to disregard the prior mortgage here. We read Eastern Idaho as saying only that under § 6-108, if the fair market value of the mortgaged property is greater than the amount expended by a purchaser at the foreclosure sale (including amounts paid to redeem from prior mortgages) then fair market value will be used to compute the amount of the deficiency. If the total price paid to acquire the property is greater than its fair market value, the cost of acquisition will be used to compute any deficiency.
Unlike Eastern Idaho, here there was no difference between the costs to the *494 Thompsons for acquisition of the property and its fair market value. Both were $57,000. In the present case the parties stipulated that the amount bid at the foreclosure "sale" was fair market value. The purchaser, the Thompsons, "paid" this amount by assuming the balance owing on the first deed of trust, and by crediting the difference against the amount of the indebtedness secured by the second deed of trust. The "reasonable value" of the property, as found by the district judge, was the difference between the fair market value and the amount owing on the first deed of trust. Because the Thompsons bid at the sheriff's sale matched the fair market value, less the amount owing on the first deed of trust, the credit allowed to the Kirsches against the mortgage indebtedness secured by the second deed of trust was equal to the property's "reasonable value." The approach taken by the district judge was correct. We must therefore reject the Kirsches' claim that the Thompsons were not entitled to any deficiency judgment. We next address whether the court erred in determining the amount of the deficiency judgment either by incorrectly computing the amount of the mortgage indebtedness or by incorrectly computing the amount of credit that the Kirsches should have received against the mortgage indebtedness.

II
The district court computed the mortgage indebtedness on the note and deed of trust held by the Thompsons by adding several amounts. First, the court calculated the amount owed on the Thompson note as $28,263.87. Of this amount, $23,664.55 was principal and $4,599.32 interest.[1] Second, the court determined that pursuant to a clause in both the Thompson note and deed of trust, the Thompsons were entitled to collect attorney fees. The court found that $5,000 was a reasonable amount for attorney fees, and the Kirsches do not dispute this figure. Third, the court added the advances the Thompsons had made to L & N to prevent foreclosure of the first deed of trust. The parties' stipulation shows the Thompsons had made eighteen payments of $362 through January 1, 1981. They had also paid $238.30 in late charges, making the total advanced $6,754.30. The court added these "advances," plus interest, to the amount the Kirsches owed on their note. Finally, the court added the sums the Thompsons had advanced for insurance, power, water, sewer, cleaning, lawn care, an appraisal and a foreclosure title report. The sum of these advances was $812.58. The court allowed interest on this amount in the sum of $33.13, resulting in a total of $845.71. The court computed the grand total of all these sums as $42,334.92 and used this figure as the amount of mortgage indebtedness on the second deed of trust.
The Kirsches contend that it was error for the district court in determining the amount of mortgage indebtedness to include any amounts the Thompsons paid to service the debt on the first deed of trust and to prevent foreclosure of the prior lien. The Kirsches claim that these advances must be deducted from the mortgage indebtedness, thus reducing the amount of deficiency by $6,754.30 plus interest allowed. The Thompsons contend on the other hand that I.C. § 45-105 entitles them to be reimbursed for any sums they paid in satisfaction of the first deed of trust.
Idaho Code § 45-105 states: "Where the holder of a special lien is compelled to satisfy a prior lien for his own protection, he may enforce payment of the amount so paid by him, as part of the claim for which his own lien exists." Idaho Code § 45-903 provides: "The lien of a mortgage is special, unless otherwise expressly agreed, and is independent of possession." Since the second deed of trust held by the Thompsons was functionally equivalent to a mortgage, we hold that the Thompsons' lien was special. Accordingly, I.C. § 45-105 entitled them to include payments they made to prevent foreclosure of the first *495 deed of trust as part of the mortgage indebtedness created by their junior encumbrance. See also Miller v. Stavros, 174 So.2d 48, 49 (Fla. Dist. Ct. App. 1965) (holding that "amounts paid by the holder of a second mortgage to protect his security are properly included in a decree foreclosing the second mortgage"). Moreover, the deed of trust signed by Mr. Kirsch specifically required him, as one of the grantors, to pay when due "all [prior] encumbrances, charges and liens, with interest." It authorized the Thompsons to make such payments when deemed necessary to protect the security of the second deed of trust. Finally, it gave the Thompsons the right to recover such advances from the grantors "with interest from the date of expenditure at eight per cent per annum."
We believe, however, that certain errors made in calculating the amount of the deficiency judgment require us to vacate the judgment. We remand the case to the district court for additional findings, recomputation and entry of an amended deficiency judgment.
First, we note that the parties stipulated that as of January 13, 1981 there was $23,664.55 principal and $4,786.04 interest owing on the Thompson note, or a total of $28,450.59. They also stipulated that after January 13, 1981 the accruing interest (at twelve percent) would be $7.78 per day. However, the computation of accrued interest in the decree of foreclosure did not correspond to the parties' stipulation. Moreover, yet another unexplained adjustment to accrued interest was made in calculating the amount of the deficiency judgment. Apparently, the district judge chose to rely upon the affidavit of Victor Thompson in making his final calculations, rather than upon the stipulation. The district judge should recalculate the interest accrued as of March 11, 1981 following the parties' stipulation. The judge should make appropriate findings of fact which show the figures he relies upon in calculating the deficiency judgment.
Second, in the decree of foreclosure entered March 11, 1981, the district judge determined the amount owing to L & N on the first deed of trust as of January 13, 1981. However, after the foreclosure sale was conducted on April 1, 1981, the judge used different figures  again supplied by the affidavit filed by Victor Thompson  to determine the deficiency. The affidavit pointed out and purported to correct certain errors in the decree of foreclosure. It also claimed additional advances. The judge made no corrections to the decree itself, nor made any new findings. It is apparent the judge relied upon the affidavit. He allowed the claimed additional advances up to and including the date of sale, April 1, 1981. As we discuss later, this was error. The decree of foreclosure should have provided the cut off date for all advances claimed by the Thompsons. The affidavit also listed other expenses the Thompsons paid for lawn care, water and power furnished to the property. The affidavit then showed new figures for the amount due on the L & N note, the new amount of the mortgage indebtedness secured by the Thompsons' deed of trust, new figures for the credit to be given the Kirsches and the final resulting deficiency amount. Based on these new figures, the district court later signed the deficiency judgment which is the subject of this appeal.
We are persuaded by the Kirsches that the district judge erred by including in the mortgage indebtedness those payments and advances made by the Thompsons after the entry of the decree of foreclosure. Idaho Code § 6-108 requires the court to determine the amount of the mortgage indebtedness in the decree of foreclosure. The decree of foreclosure provides the cut off date for fixing the amount of the mortgage indebtedness. "The decree directing a sale of the premises should find the exact amount due on the mortgage and not leave this to be calculated by the officer."[2] 3 L. JONES, LAW OF MORTGAGES *496 OF REAL PROPERTY § 2042 at 493 (8th ed. 1928).
In Horne v. Smith, 368 So.2d 392 (Fla. Dist. Ct. App. 1979), the court cited Miller v. Stavros, supra, for the following proposition:
Amounts paid by the holder of a second mortgage to protect his security are properly included in a decree foreclosing the second mortgage... . Payments in reduction of an indebtedness on a prior mortgage, made by foreclosure purchaser after decree and foreclosure sale, are not recoverable from the mortgagor.
368 So.2d at 394. A purchaser at a mortgage foreclosure sale is presumed to have made allowances for prior liens in making his bid. Id. We believe the rule should be the same in Idaho. Accordingly, we remand to the district court with the following instructions.
The district court should redetermine the amount of principal and interest owing on the L & N note as of March 11, 1981. This amount, deducted from the $57,000 sale price (fair market value), will determine the amount of the credit to be given the Kirsches against the total amount of the indebtedness secured by the second (Thompsons') deed of trust. In determining the amount due and owing to L & N as of March 11, 1981, the court should take into consideration any funds then held by L & N on that date in tax and insurance reserve accounts. The Kirsches are to be given appropriate credit for the amount of those reserves.
The district court should redetermine the amount of the "mortgage indebtedness" secured by the Thompsons' deed of trust. This will include advances made by the Thompsons up to the date of the decree of foreclosure with interest on said sums from the date when made to March 11, 1981 at the rate of eight percent per annum. The Thompsons' deed of trust specifically provides for the payment of interest on advances at that rate. There appears to be an error in computation of interest on the $3,858 advancement made by the Thompsons on May 6, 1980. This should be recomputed. The Thompsons' deed of trust authorized them to make payments for necessary and proper maintenance expenses, if those were not paid by the grantors, and to include those payments as part of the mortgage indebtedness. Therefore, those expenses incurred prior to March 11, 1981 should be allowed with interest to that date at eight percent per annum. Any expenses paid after March 11, 1981 cannot be considered as part of the mortgage indebtedness. Such expenses can only be considered in computing the deficiency judgment if they are bona fide costs of the foreclosure sale. This is for the trial court to determine. The principal and interest owing on the Thompsons' note as of March 11, 1981 should also be recomputed and added to the advancements to arrive at the total mortgage indebtedness.
Finally, in computing the amount of the corrected deficiency judgment the district court should make calculations allowing accrued interest as follows. Interest will accrue on the total amount of the mortgage indebtedness, including foreclosure costs and attorney fees as determined by the decree of foreclosure, from March 11, 1981 to the date of the sale, April 1, 1981, at the statutory rate of eight percent per annum in accordance with former I.C. § 28-22-104(4). See, e.g., Beeler v. American Trust Co., 28 Cal.2d 435, 170 P.2d 439 (1946); Schmisseur v. Rebhan, 294 Ill. App. 172, 13 N.E.2d 627 (1938) and Hudson City Sav. Bank v. Hampton Gardens, Ltd., 88 N.J. 16, 438 A.2d 323 (1981). Compare Kamaole Resort Twenty-One v. Ficke Hawaiian Inv., 60 Hawaii 413, 591 P.2d 104 (1979). The amount of the mortgage indebtedness should be adjusted by deducting, as of the date of sale, (as determined in the decree of foreclosure), the "reasonable value" of the property. The amount then remaining will continue to bear interest from the date of sale at the rate of *497 eight percent per annum to the date the original deficiency judgment was entered, May 22, 1981. The total amount found due in the deficiency judgment, including allowable costs of the sale, if any, will thereafter bear interest at the applicable judgment rate.
Cause remanded for further proceedings consistent with this opinion. No costs or attorney fees on appeal.
WALTERS, C.J., and BURNETT, J., concur.
NOTES
[1]  The interest figure is in error. At least it does not correspond with other findings of fact in the decree of foreclosure and in the district court's earlier memorandum decision.
[2]  This, of course, does not preclude the decree from setting forth a per diem amount of interest which will accrue from the date of the decree to date of sale. Also, it does not preclude adding costs of the foreclosure sale in computing the amount of any deficiency judgment.
