Mr. Chief Justice Alvey
delivered the opinion of. the Court:
The bill in this case was filed by the appellant, The Alfred Richards Brick Company, against Mary G. Atkinson, Frederick S. Sinclair, Marie E. Sinclair, infant children and wards of the said Mary G. Atkinson, formerly Mary G. Sinclair, and against certain other named defendants, for the purpose of subjecting certain property to a mechanics’ lien, and enforcing such lien by a decree for the sale of the property.
The bill alleges that Mrs. Atkinson, as guardian of her two infant children, being in possession of the sum of $2,766 belonging to her wards, without any authority and in violation of her duty, invested the sum of $1,550, part of said sum of $2,766, in the purchase from the defendant, Jackson H. Ralston, of lot number 110, in square 151, in the city of Washington, and received a deed therefor; and, by way of payment of the purchase money for said lot, she took up a note of said Ralston, secured by a deed of trust on said lot, for $1,300. That the deed of trust for the security of the note for $1,300 had been made to. and was held by the defendants, Francis H. Smith and Harvey T. Winfield, as trustees; that the deed for the lot made to Mrs. Atkinson was made with the following declaration of trust therein: “ In trust to hold for the benefit of Frederick S. Sinclair and Marie S. Sinclair, as tenants in common, their heirs and assigns, with full power in said trustee, in her discretion, to sell, convey and incumber the same by way of mortgage or deed *464of trust, without obligation on the part of the purchaser or lender to see to the application of the money paid or loaned by them.”
Having thus obtained title to the lot, Mrs. Atkinson contracted with one C. C. Graham, a builder, for the erection of a dwelling house thereon, for the sum of $2,200, and the house was commenced about the 15th of March, 1898; that some time thereafter Mrs. Atkinson borrowed the sum of $1,000, and reissued upon her own responsibility and deposited the said note of $1,300 as collateral security for said loan; but it is alleged that the present holder of the note for the $1,000 borrowed is not known; and discovery of the holder is called for by the bill. It is alleged that the plaintiff furnished bricks for the erection of the house to the amount of $292.
It is also alleged that Mrs. Atkinson was cited to appear in the Orphans’ Court of the District to answer and account for her dealings with the funds of her wards, in the purchase of said lot and building thereon without authority; that she answered the citation and stated an account, wherein she charged herself with the $2,766, and interest thereon to April 6, 1898, and claimed credit for" commissions and for support and maintenance of said wards, leaving a balance due the wards of $2,035.45; and then and there stated, “that to the extent of the investment made by her in said house and lot, of money belonging to her said children, she holds the same in trust for them.”
It is further alleged that the said guardian, Mrs. Atkinson, was required by the Orphans’ Court to give counter security to save harmless the surety on her guardian’s bond; and, for that purpose, on June 9, 1898, she executed, in her own individual right and as trustee under the deed to her of March 19, 1898, a deed of trust of said house and lot to the defendants Barnard and Ralston, in trust for herself, her heirs and assigns; the specific trust declared being in the following terms: “In trust for the said Mary G. Atkinson, *465her heirs and assigns, with full power in her and them to use and enjoy the same, and take the rents of said premises until some default takes place under the provision of this trust; and upon the further trust, in case the said Mary G. Atkinson should not hold the defendant, Richard E. Sinclair, harmless as surety upon her said guardian’s bond, and upon certain other defaults in the payment of taxes, prior incumbrances, insurance, or, if at any time the security of said Sinclair becomes endangered by reason of any act or omission on the part of said Mary G. Atkinson, her heirs and assigns, to sell said premises, with power to reinvest the proceeds upon the same trusts, and when said Sinclair shall be relieved of liability upon said bond, to reconvey said premises to said Mary G. Atkinson.”
It is further alleged in the bill that Graham, the contractor for the erection of the house, died about the 14th of May, 1898, and before the house was completed, but that said house was subsequently finished; and that the plaintiff, within the time prescribed by law, filed, in due form, notice of its intention to claim and hold a lien upon said premises for the amount of the material furnished as aforesaid.
The plaintiff also alleges, upon information and belief, that upon a proper statement of account between said Mary G. Atkinson and the said Graham or his estate, a fund will be disclosed in the hands of said Mary G. Atkinson, subject to the lien of plaintiff, sufficient to satisfy the same in full; and that the plaintiff is entitled to have the property sold and the proceeds applied to the satisfaction of its lien claim; and the bill prays for relief accordingly.
The defendants all entered demurrers to the bill; some separately and .others jointly. The grounds of demurrer, as stated therein, were, that the bill of complaint was filed to secure a decree for the sale of real estate belonging to infants upon a mechanics’ lien filed agáinst them; and that the estate of infants can not be charged or sold under the *466circumstances set forth in the bill of complaint,and therefore no cause of action cognizable by a court of equity has been stated in said bill.
Upon hearing on the demurrers the bill was dismissed, and from the order dismissing the bill this appeal has been taken.
The bill is certainly very inartificially drawn, and it seems to proceed upon the theory that the mother, Mrs. Atkinson, held the lot and premises as trustee for her children, with power not only to sell, convey and incumber the premises by way of mortgage, according to the terms of the deed to her, but to build thereon, and, as incident to that right and power, to suffer a mechanics’ lien to be fixed thereon, superior and paramount to the rights of her infant wards, whose money she had, without authority, invested in the purchase of the lot. This she clearly had no right to do either in her character of guardian, or as trustee under the deed to her. This deed to her was matter of record, and every person dealing or contracting with her in 'respect to the property, whether as builder or the furnisher of materials for building, was bound to take notice of the trust declared in the deed, and the limitation of that trust. The trust, it is true, was a self-imposed duty, raised upon the money of her wards that she had invested without authority; but it was, and is still, the right of those wards to follow their money thus wrongfully invested in this property, and that right is superior to any right acquired by others under Mrs. Atkinson, the guardian, with notice of the rights of her infant children. The money belonging to the -wards in the hands of their mother, as guardian, was a trust fund; and the principiéis now too well settled to admit of question, that as between cestui que trust and trustee, and all parties claiming under the trustee, otherwise than by purchase for valuable consideration without notice, all property belonging to a trust, however much it may be changed or altered in its nature or character, and all the fruit of such property, *467whether in its original or in its altered state, continues to be subject to or affected by the trust. This is so, for the reason, as declared by Jessell, M. R., in the case of In re Hallet’s Estate, 13 Chan. Div. 696, “ that the product of or substitute for the original thing still follows the nature of the thing itself, as long as it can be ascertained to be such, and the right only ceases when the means of ascertainment fail.” These principles are fully approved and adopted by the Supreme Court of the United States in the case of National Bank v. Insurance Co., 104 U. S. 54, 67, 69, where all the principal authorities upon this subject are reviewed. See, also, Englar v. Offutt, Trustee, 70 Md. 78, 86, 87; and Pennell v. Deffell, 4 DeGex, McN. & G. 372.
If, however, there is an interest in the property, though it may be but an equitable interest, acquired by Mrs. Atkinson, the guardian, by reason of her own money contributed to or expended in the erection of the house on the lot, that interest, whatever it may be, should be subject to the lien claimed by the plaintiff for the materials furnished for the erection of the house. But, in order to make the lien effective as against such interest in the property, it should be charged in the bill and clearly shown in proof what that interest is, and that such interest of Mrs. Atkinson in the property is sufficient to discharge the lien, over and above the amount of the funds belonging to her wards that she invested in the property, with interest thereon, upon proper statement of accounts with her wards. The bill, however,is not framed upon that theory of the case. And before relief can be granted, upon equitable principles, to reach the interest of Mrs. Atkinson in the property, the bill should be amended and the proper allegations be made as to the interest sought to be affected by the lien.
There was, however, no application made to the court below for leave to amend; and the case having been heard upon demurrers to the whole bill, and the demurrers properly allowed, the usual effect is that the bill is out of *468court, and, therefore, can not be regularly amended. . This is certainly the ordinary course of proceeding. But this is not always the course that the court will pursue where it can perceive that justice requires a different course. Sto. Eq. Pl., Sec. 459. “ There is no doubt,” says Lord Chancellor Eldon, in Baker v. Mellish, 11 Ves. 71, “ it is competent to the court to give leave to amend after demurrer allowed to the whole bill. It is frequently said in the books, that when a demurrer to the whole bill is allowed, the bill is out of court, and the plaintiff must begin again. Strictly speaking, that is the principle. But I know many instances, where, after a bill dismissed by order it has been considered in the discretion of the court to set the case on foot again. That is an express judgment of the court which ought to have its effect; and yet in such a case the court has interfered.”
We think in this case the bill ought not to be dismissed unless the plaintiff decline to amend as suggested. We shall, therefore, reverse the decree dismissing the bill and remand the cause that the plaintiff may obtain leave to amend the bill within such reasonable time as the court may designate for that purpose; or, upon failure so to amend, that the bill stand dismissed. The appellant to pay cost of the appeal.
' Decree reversed and cause remanded.