after stating the case, proceeded : The mechanic’s lien, as provided and contemplated by the statute {The Code, §§1782, 1784, 1789) is “preferred to every other lien or incumbrance, which attached upon the property subsequent to the time at which the work was commenced, or the materials were furnished.” The same statute (The Code, § 1801) gives “ sub-contractors and laborers who are employed to furnish, or who do furnish, material for the building, repairing or altering any house or other improvement on real estate,” “ a lien on said house and real estate for the amount of such labor done or material furnished, which lien shall be -preferred to the mechanic’s lien now provided by law, when notice thereof shall be given” as prescribed and required.
Such sub-contractor, labor or material man, who claims a lien as provided in the last-mentioned section, “ may give notice to the owner or lessee of the real estate who makes the contract for such building or improvement at any lime before the settlement with the contractor, and if the said owner or lessee shall refuse or neglect to retain out of the *661amount due the said contractor under the contract as much as shall be due'or claimed bj7 the sub-contractor, laborer or material man, the sub-contractor, laborer or material man may proceed to enforce his lien, and after such notice is given, no payment to the contractor shall be a credit on ora discharge of the lien herein provided.” The Code, § 1802. The notice thus required is intended to charge the owner or lessee of the land to withhold so much of the money due to the’contractor as will pay the sub-contractor’s claim. If he fails to do so, he cannot avoid his liability by paying the contractor.
In order to create and perfect a lien, the sub-contractor or laborer, must within twelve months next after the completion of the labor, or the final furnishing of the materials, file the notice of his claim in the office of the Superior Court Clerk, as required by the statute (The Code, §§ 1784, 1789). When the notice is thus filed the lien is at once established, and relates back to and is effective from the time at which the work was commenced, or the materials were furnished. The statute (The Code, §1782) so expressly provides, and, thus established, the lien is preferred to every other lien, including the mechanic’s lien, that may have in any way attached to the property subsequently to that time. The Code, §1802; Burr v. Maultsby, 99 N. C., 263; Pinkston v. Young, 104 N. C., 102. The certain purpose is to protect the sub-contractor or laborer as to his claim against the owner of the property and all liens of whatever character that may attach to the property subsequently, not simply subsequently to the filing of the notice of claim in the office of the Superior Court Clerk, but as well subsequently to the time when the work was commenced or the materials were furnished.
In this case it is not questioned that the plaintiff had a claim as sub-contractor — that he gave notice to the defendant, the owner of the land and building, and filed the same in the office of the Superior Court Clerk, as required by law, *662on tlie 11th day of August, 1891, the day next after the deed of trust was executed and registered, to secure a large debt due from the defendant to the contractor Sanford. That that notice was thus filed after that deed of trust was registered, cannot prejudice the plaintiff’s lien — it was preferred to the deed of trust — the filing of it within twelve months next after the materials were furnished perfected it as of the time they were so furnished. Burr v. Maultsby, supra.
That the contract between the defendant and Sanford was executory, and is not yet executed, cannot prevent the lien of the plaintiff or delay its enforcement, because the defendant failed, after notice to it, to retain out of the amount due the contractor a sum sufficient to pay the plaintiff’s claim and refused to pay it. In that case the plaintiff had the right to proceed at once to enforce its lien. The Code, § 1802. The trustee, by virtue of the deed to him, took the legal title to the property subject to the lien of the plaintiff, and it was the duty of the defendant to discharge that lien, and if it would not, then the trustee might have done so. He had and was charged with notice of it.
There is nothing in the statute, nor is there any principle of justice, that postpones the enforcement of the plaintiff’s lien until the buildiog shall be completed and the contract fully executed. This may never be done. As we have seen, the purpose of the statute is to protect the sub-contractor and the laborer effectually. The remedy was not simply against the defendant and Sanford, the contractor. They would not, or could not, pay the plaintiff’s debt. The very purpose is to' give a remedy against the property, not after all other remedies shall be exhausted, but when and as soon as the defendant refused to pay it after notice.
It might be better if the trustee had been made a party with a view to conclude him and those whom he represents, but he is not an essential party. The defendant might have asked to have him brought into the action, or he might have *663applied to be made a party. But there is no reason why the land may not be sold under the order of the Court to enforce and give practical effect to the plaintiff’s lien. The land is charged with the lien, and may be sold notwithstanding the conveyance to the trustee. It is his duty to see that he'has title and to protect it by such means as are properly within his power. It is his folly or neglect if he will not. If the land shall be sold properly to satisfy the debt of the plaintiff and discharge his lien, the title will pass, just as if it had been sold under execution to satisfy a duly docketed judgment which was a lien upon it. Kornegay v. Steamboat Go., 107 N. C., 115.
We think, however, that the contractor, Sanford, should have been made a party defendant so that the plaintiff might have obtained judgment for its claim against him as well as the defendant. He is the principal debtor and the plaintiff must establish his claim against him. This it has not done and cannot do until he shall be brought before the Court in a proper way and have his day in Court. He might be able to allege and prove that the plaintiff’s claim is unfounded, that he had paid it in whole or in part, or make other defence and thus avoid the lien.
He should have been, and must yet be, made a party, and have opportunity to make defence. To that end, let this opinion be certified to the Superior Court.
Error.