
    John P. Morris, Respondent, v. Andrew S. Wheeler, impleaded with Margaret Kenny and others, Appellant. Margaret Barr, Respondent, v. The Same Appellant.
    In an action for the foreclosure of a mortgage, sale of the premises and satisfaction of the debt seemed, all persons having liens upon the equity of redemption are necessary parties.
    A judgment against husband and wife, for damages and costs, entered in an action of ejectment, duly docketed, is a lien upon the real estate of the wife. If she is owner of the equity of redemption in mortgaged premises, the judgment creditor is a necessary i>arty in an action to foreclose the mortgage.
    Although costs in actions of foreclosure are in the discretion of the court, yet if it appears that such discretion has been exercised under an erroneous view of the law affecting the rights of the parties, it is the duty of the appellate court to correct the error. '
    (Argued June 8th;
    decided June 22d, 1871.)
    Two appeals from orders of the General Term of the Supreme Court, in the second district, affirming judgments of foreclosure with costs and five per cent allowance, rendered at Special Term.
    These were actions for the foreclosure of two mortgages on the same premises, both commenced at the same time.
    The defendant, Margaret Kenny, was the owner in fee" of the mortgaged premises up to the afternoon of June 3d, 1869, when the appellant, Wheeler, purchased the same. Summons was served on Wheeler June 4th, 1869.
    The complaints are in the usual form for foreclosure of a mortgage. The answer alleges defect of parties, in that one Griswold had recovered a judgment against the defendants, Edward Kenny and Margaret Kenny, Margaret being then owner in fee of the mortgaged premises, which judgment, was docketed before the commencement of the action, and in August, 1868, and was for $182.09.
    It appeared on the trial, that this judgment was rendered in an action of ejectment, “against Edward Kenny, Margaret Kenny, his wife, and William Kenny,” and that it had been satisfied, as to Edward and Margaret, subsequent to the service of the answers in these actions, and on the 22d of October, 1869.
    Judgment was rendered in each action for foreclosure and sale, with costs and an additional allowance of five per cent, to be paid from the avails of sale.
    
      Samuel Hand, for the appellant,
    that the judgment was a lien, cited Corn. Exch. v. Babcock (42 N. Y., 613); Taylor v. Crane (15 How., 358); Schuyler v. Marsh (37 Barb., 350); Eckerson v. Valmer (11 How., 42); Howland v. Fort Edward Paper Mill Co. (8 How., 505); Horton v. Payne (27 How., 374); First Nat'l Bank of Canandaigua v. Carlinghouse (53 Barb., 615); Thompson v. Sargent (15 Abb., 452). That Griswold was a necessary party, he cited Ensworth v. Fanning (4 John. Ch., 605); McGown v. Yerks (6 John. Ch., 450).
    
      William S. Cogswell, foi’ the respondent,
    urged that satisfaction of the judgment was analogous to a discontinuance before notice of trial when there is plea of another action pending. (Averill v. Patterson, 10 N. Y., 500; Swart v. Borst, 17 How., 69; White v. Smith, 4 Hill, 166.) That Griswold was never a necessary party, citing Baldwin v. Kimmell (16 Abb., 354); Valentine v. Lloyd (4 Abb. N. S., 371); Corn. Exch. v. Babcock (42 N. Y., 613); Porter v. Mount (45 Barb., 422). That costs were in the discretion of the court. (Pratt v. Ramsdell, 16 How., 59; Barton v. Cleveland, id., 364).
   Grover, J.

When there is a defect of parties, not appearing upon the face of the complaint, the objection should be taken by the answer. (Code, § 147.) In an action for the foreclosure of a mortgage, and a sale of the mortgaged premises for the satisfaction of the debt secured, all persons having liens upon the equity of redemption ar"e necessary parties. (Ensworth v. Fanning, 4 Johns. Ch., 605; McGown v. Yerks, 6 id., 450.) The answer set forth that Nathaniel L. Griswold was a necessary party, for the reason that he had recovered a judgment in the Supreme Court against Edward Kenny and Margaret, his wife, which was docketed in Kings county and was a lien upon the equity of redemption in the mortgaged premises. If this was true, the objection interposed was valid. Upon the trial the defendants introduced the record of a judgment in the Supreme Court, from which it appeared that Griswold had commenced an action for the recovery of the possession of certain premises in Kings county, against Edward Kenny and Margaret, his wife. That the defendants appeared in said action and an issue of fact was joined therein; and upon trial a verdict was found for the plaintiff against both defendants, upon which judgment was.rendered against both for damages and costs, which was duly docketed so as to become a lien upon real estate. It further appeared that Margaret }£enny, the wife, was the owner of the equity of redemption, at the time the judgment was docketed, in the premises sought to be foreclosed by this action. The judge found, as a legal conclusion, that this judgment was not a lien upon the separate real estate of Margaret' Kenny, and that Griswold was not therefore a necessary party. In this I think the learned judge erred. Upon the argument the question was discussed whether, in an action of ejectment against husband and wife, a judgment could be recovered against the wife. In case the wife claimed the land as her -separate property, adverse to the title of the plaintiff, she may be made a defendant for the purpose of determining the validity of such claim. (Code, § 118.) In such case, if her title was found invalid, a verdict and judgment against her would be proper. But the question in this case is not whether the judgment was rightly rendered against the wife. The °court had jurisdiction of the parties, and of the subject-matter, and the judgment rendered, if erroneous, bound the parties and their property, until reversed. The question then is, whether a judgment against husband and wife is a lien upon the real estate of the wife. Section 282 of the Code declares that a judgment shall he a lien on the real property, in the county where the same is docketed, of every person against whom it was rendered. This includes a marrried woman, the same as any other judgment debtor. Griswold was therefore a necessary party, and had there been no fact proved, obviating the objection, judgment ought not to have been given for the plaintiff, but steps should have beqn taken to make Griswold a party upon such terms as to costs as the court thought just. But it was shown by the plaintiff that the judgment of Griswold against Kenny and wife had been satisfied intermediate the service of the answer and trial. He was no longer a necessary party. The plaintiff was entitled to judgment without making him such. The only question was as to the costs of the action. These were in the discretion of the court. (Code, §§ 304-306; Pratt v. Ramsdell, 16 How. Pr., 59.) With the exercise of this discretion this court will not interfere, unless it appears that it was exercised under erroneous views of the law affecting the rights of the parties. In this case it does so appear. The judge held that the judgment against Mrs. Kenny was not a lien upon the equity of redemption, and consequently that the answer setting up the non-joinder of Griswold as a party defendant constituted no defence, and that the plaintiff would have been entitled to judgment, although that judgment had not been satisfied before the trial. Hnder this view of the law, the judge very properly held that the plaintiff was entitled to recover costs. He would not so have held had he regarded the judgment of Griswold a lien, and consequently Griswold a necessary party, and the plaintiff not entitled to judgment until he was made a party, or the difficulty otherwise obviated. It is manifestly unjust to charge the defendant with the costs incurred in litigating a question in which the plaintiff was in the wrong ;' and yet, had the Special Term done this, under correct views of the law, this court would not have interfered with the exercise of its discretion. But the court having allowed costs to the plaintiff, under the mistaken idea that the answer, when interposed, constituted no defence, it is the duty of this court to correct the error. The plaintiff was not entitled to the per centage given by section 308 of the Code, unless he recovered costs in the action. This per centage is given as costs, in addition to the other allowances therefor. The case shows that the parties have been strenuously litigating through all the courts upon a mere question of costs, and as the defendant was in the right upon the question presented by the answer, and in the wrong in not having paid the debt when due, and withholding such payment during the litigation, justice will be done by denying costs to each as against the other.

The judgment of the Special and General Terms allowing costs, including the per centage, should be reversed, and the residue of the judgment affirmed, without costs to either party in this court.

All concur.

Judgment reversed as to the allowance of costs and per centage, and affirmed as to the residue, without, costs in this court to either jparty.  