
172 Cal.App.2d 388 (1959)
B. D. DOCKREY, Respondent,
v.
E. L. GRAY et al., Appellants.
Civ. No. 9602. 
California Court of Appeals. Third Dist.  
July 28, 1959.
 E. L. Gray, in pro. per., and Arthur E. Hewitt for Appellants.
 Steel & Arostegui and Thomas A. Tweedy for Respondent.
 SCHOTTKY, J.
 This is an appeal from a judgment in favor of plaintiff in an action by the holder of a mechanic's lien to reach the surplus after sale of the property to which the lien attached, such sale having been made pursuant to a power of sale under a prior deed of trust. After the action was filed the controversy was submitted to the trial court on an agreed statement of facts. With the permission of the court, another mechanic's lien holder filed a complaint in intervention, but such interveners have not appealed from the judgment in which it was held that they take nothing by their complaint.
 On or about October 17, 1955, M. D. Lowery and Wanda Mae Lowery (hereinafter referred to as trustors) applied for and were granted a loan of $8,000 by the appellant Midvalley Savings and Loan Association (which will be referred to as the association) to finance the construction of two dwellings. A first deed of trust on the property upon which the dwellings were to be constructed was executed contemporaneously with the note evidencing the loan. Under the deed of trust the Lowerys were trustors, the association was beneficiary, and appellants E. L. Gray and N. J. Laughlin were trustees. It is apparent from the answer of appellants that appellant Midvalley Auxiliary Corporation was a substituted trustee, and it is stipulated that Midvalley Auxiliary Corporation was trustee under all outstanding deeds of trust of the association.
 The deed of trust was recorded on October 27, 1955. At the time of said recording no materials had been delivered nor had work commenced on the construction of the dwellings. It is therefore not disputed that the deed of trust constituted a first lien on the property insofar as it secured the original loan of $8,000, plus interest thereon and costs amounting to $497.61.
 It should be noted that while it was provided that the deed of trust was to secure future advancements as made by the *390 association, it is stipulated that it was not mandatory upon the association to make such advancements.
 On November 10, 1955, respondent, a plumbing contractor, entered into an oral contract with trustors for certain plumbing work on the buildings. In December, 1955, the buildings suffered flood damage. On March 3, 1956, respondent received $800 from appellant association in part payment for work in progress.
 On May 21, 1956, appellant association recorded an agreement to make a $1,500 advance to trustors. It is stipulated that at the time the advancement was made the association had actual notice of respondent's lien rights.
 On September 26, 1956, respondent recorded his mechanic's lien and on October 30, 1956, filed a complaint against trustors to foreclose the mechanic's lien. None of the appellants were joined in the foreclosure action.
 On January 10, 1957, trustors assigned to the association their rights to any excess over $8,000 which might result from bids at a trustee's sale of the property.
 On January 14, 1957, a certified copy of a judgment in favor of respondent in the foreclosure action was recorded.
 On January 15, 1957, the trustee sold the property pursuant to the power of sale in the first deed of trust for $9,600.
 The action involved in the present appeal was filed January 16, 1957.
 The issue involved in this appeal is whether appellants, under their voluntary advancement, are entitled to the surplus arising at the trustee's sale over the original amount secured by the first deed of trust, or whether respondent is entitled to such surplus. There can be no doubt but that by virtue of appellants' actual notice of respondent's lien rights the voluntary advance made by appellants was an encumbrance junior in priority to that of respondent's mechanic's lien. (See Code Civ. Proc.,  1188.1; Yost-Linn Lumber Co. v. Williams, 121 Cal.App. 571, 574 [9 P.2d 324]; Althouse v. Provident Mut. etc. Assn., 59 Cal.App. 31, 38 [209 P. 1018].) Appellants concede that respondent's lien had priority as against the property, but argue that such priority does not extend to the surplus realized at the sale.
 [1] Appellants' first contention is that it was error for the court to hold that the assignment of the surplus by trustors was invalid. However, the court did not so hold, but correctly held that the assignment by the trustors did not create any *391 greater rights in the assignee association than were had by the assignor trustors.
 Appellants' second and third contentions are that it was error for the trial court to hold that the mechanics' liens attached to the surplus of the trustee's sale and that it was error to hold that the trustee's sale did not cut off respondent's lien.
 [2] It should first be noted that under the first deed of trust the trustee was required to pay any surplus "to the person or persons legally entitled thereto." It is clear that respondent's lien, being next in priority to the first deed of trust, would make respondent the person entitled to the proceeds after the amount secured by the trust deed has been satisfied unless his lien was in some way extinguished.
 [3] It is true, as appellants contend, that all liens subsequent to the date of the deed of trust are destroyed as against the property itself upon a sale under the deed of trust. (Cook v. Huntley, 44 Cal.App.2d 635, 640 [112 P.2d 889].) However, this does not mean that such lien holders are without remedy. [4] As was stated in Sohn v. California Pacific Title Ins. Co., 124 Cal.App.2d 757, at page 766 [269 P.2d 233]: "... There was here a junior encumbrance, which was eliminated by the exercise of the power of sale, consequently the junior lien attached to the surplus proceeds so that the Berberian creditors ... [the holder of the second trust deed] became the 'persons legally entitled thereto' as provided in said deed of trust."
 Appellants argue that the above quotation from the Sohn case is dicta. We do not agree as the court was there drawing a distinction between the lien of a second trust deed which is extinguished as against the property by trustee's sale and therefore in equity attaches to the surplus and a federal tax lien which is not extinguished as against the property and which therefore does not attach to the proceeds of the sale. But even if the statement in the Sohn case is dicta, we believe that the equitable principle expressed therein is sound and supported by ample authority. In Markey v. Langley, 92 U.S. 142, at page 155 [23 L.Ed. 701], it was held that: "The liens of the mortgages and the mechanics' lien attached to the proceeds of the sales in the same manner, in the same order, and with the same effect, as they bound the premises before the sales were made."
 Other authorities are in accord with the above principle. (See 59 C.J.S., Mortgages,  596, p. 1032, cited in Pearson v. *392 Teddlie (Tex.Civ.App.), 235 S.W.2d 757, 759; 37 Am.Jur., Mortgages,  874; 117 A.L.R. 1065, 1066.)
 [5] Appellants' final contention is that they were not joined in the respondent's suit to foreclose his lien against the trustors. Appellants fail to point out how this fact would affect the validity of the judgment involved herein. It is true that a judgment in a foreclosure suit wherein all of the interested parties are not joined has no effect upon the rights of the parties not joined. However, a failure to join such parties in no way improves their rights. Appellants were accorded the opportunity in the instant action to set forth any defenses which they may have had, and there is no indication that the judgment which is involved in this appeal is in any way dependent upon or procedurally related to the prior foreclosure proceeding.
 The judgment is affirmed.
 Van Dyke, P. J., and Warne, J., pro tem.,  [fn. *] concurred.
NOTES
[fn. *]  *. Assigned by Chairman of Judicial Council.
