If it be true that the plaintiff was not entitled to the immediate possession of the goods at the time 'he brought this action of replevin, because the attachment, being void ab initia, was not a breach of the condition in the mortgage that the mortgagor should not suffer the goods to be attached; and the mortgage provided that, until default in the performance ■of the condition, the mortgagor might retain possession of the property, still the parties are concluded by the judgment that has been entered. Whether there were breaches of some of the dther conditions of the mortgage we do not know, but the judgment establishes the right of the plaintiff to maintain the action, and involves a finding that the plaintiff, at the time he brought the action, was entitled to the immediate possession; otherwise, there could have been no judgment for the plaintiff.
The justice, who assessed the damages without a jury, ruled that the. plaintiff “ was entitled to recover the damages to the goods directly caused by the taking and detention of the same; ” and refused to rule that the defendant was only liable for nominal damages, although it was shown that the goods when replevied were of greater value than the amount due under the mortgage. The legal title to the whole property was in the plaintiff; he was entitled to the possession of it, although it was more than sufficient to pay the mortgage debt. It is true that a judgment for the plaintiff does not necessarily show that the taking was unlawful, because the action lies for an unlawful detention as well as an unlawful taking; Whitman v. Merrill, 125 Mass. 127; but it has been decided that the taking in this case was unlawful. Allen v. Butman, 134 Mass. 347, 350.
As both the taking and the detention were unlawful, we think the ruling was right. The damages are measured by the injury *588to the property caused by the unlawful acts. If the mortgagee gets more than is sufficient to satisfy the mortgage, he holds it for the benefit of the mortgagor. Byrom v. Chapin, 113 Mass. 308. Gooding v. Shea, 103 Mass. 360. Gordon v. Jenney, 16 Mass. 465. Exceptions overruled.