This is a proceeding in the nature of a writ of error coram nobis begun in the circuit court of Pettis county. By reference to the statement in the cause, it will be seen that the party defendant, principal in interest in the cause, died after service had upon him, but before the judgment was rendered. He had made no appearance to the suit, and the fact of his death was not known to the court at the time of rendering the judgment, and nothing from which it could be ascertained appeared of record until this proceeding originated. It is from this latter fact that complaint is made by plaintiff in the original cause, that the court erred in setting aside the judgment it had theretofore rendered. The contention being that nothing can be heard dehors the record to establish the fact of defendant’s death. If this contention be true, then, not only is the form of the proceedings on a writ of error coram nobis abrogated, but the remedy, or very substance of the writ itself, is gone. For the writ was always brought into requisition to correct some error of fact which did not appear in the record and which was unknown to the court. The only authority which has been cited having any bearing on the case is Phillips v. Evans, 64 Mo. 17, which does appear to lend coun: tenance to the contention. But in the light of cases *670before and since that, we are not inclined to think the court intended to be understood to say that the proceedings in the nature of a writ coram nobis could be made effectual only when the matter complained of appeared of record. When the common understanding has always been that its chief object is to bring out those matters not appearing of record. -
The court in that case was construing section 26, page 1062, Wagner’s Statutes, and there is no doubt the construction now sought to be placed upon it was not thought of by the court, as the case went up to them merely on a motion to quash an execution. This proceeding is not for irregularity, but for error; and it has been held not to be governed by the section of the statute referred to. Powell v. Gott, 13 Mo. 459; Latshaw v. McNees, 50 Mo. 381. This writ has been held to be the remedy when the judgment was against a married woman as though single, an infant as though of age, an insane person as though sane, or in a criminal proceeding sentencing a prisoner, under age, to the penitentiary. Authorities supra, and Randolph v. Wilson, 24 Mo. 76; Walker v. Reaver, 79 Mo. 664, 674; Heard v. Sack, 81 Mo. 610; Ex parte Toney, 11 Mo. 662. And, also, when one of two defendants was dead at the time of rendering judgment, it was held to be the only remedy. Calloway v. Nifong, 1 Mo. 223; Dows v. Harper, 6 Ohio, 518. We have therefore no hesitation in declaring that- the circuit court was right in entertaining this proceeding and in hearing evidence aliunde the record to establish the fact of defendant Leyser’s death.
II. The next question involves the construction of the mechanics’ lien law as applied to those who make repairs on buildings, which; with the land upon which they are situated, are mortgaged at the time the improvements or repairs are made.
By section 3172, Revised ' Statutes, 1879, every mechanic who, under contract with the owner, performs *671work or furnishes material for any building upon land, or for repairing the same, has a lien, for such work or material, upon such building, erection or improvement, and upon the land belonging to such owner upon which the same are situated. By section 3178, the land aforesaid upon which the building or improvement is situated shall be subject to said lien only to the extent of the title or interest the owner of the building, erection or improvement has in it.
Section 3174 gives the lien on the building, erection or improvement a preference over any prior lien upon the land upon which the building has been put. We conclude that this contemplates a building or improvement which has been put on the land since the prior-lien, as, otherwise, it would not have said prior lien on the land; for, if the statute contemplated the building put up before, it would have read prior lien on the land and building.
So, taking the three sections together, our opinion is that, since a mortgage or'deed of trust on land, upon which there is a building, covers the building as well as the land, the lien for repairs or improvements, which are put upon such existing building, will be subject to the prior lien of the mortgage or deed of trust; otherwise one’s principal security might be repaired or improved from under him. But if the building, erection or improvement is an independent affair, not in existence when the mortgage was taken, it will be subject to the “mechanics’ lien” in preference to the mortgage which may have theretofore existed on the land, and it may be sold and removed as provided by statute.
In the case at bar, the buildings were in existence upon the land when the deeds of trust were given, and the repairs and improvements, for which the mechanics’ lien is sought to be enforced, were painting and glazing, and, :as such, such lien is subject to the prior deeds of ■trufet, and the circuit court was right in so declaring. *672Haeussler v. Thomas, 4 Mo. App. 463; Hall v. St. Louis Mfg. Co., 22 Mo. App. 33. And a similar statute of Iowa, the supreme court of that state has construed in the same way. Getchell v. Allen, 34 Iowa, 559.
III. While it is true that a suit to enforce a mechanic’s lien is not the proper proceeding as upon a bill in equity, to adjust and determine priorities of liens, yet when the question of priority necessarily comes up, as an incident- in the case, arising from its peculiarity, the court ex necessitate rei passes upon such question as necessary to a full determination of the case. And so it has frequently been held.
We are of the opinion the judgment should be affirmed, and it is so ordered.
All concur.