There can be no doubt of the power of the court to order a return of goods replevied, if the plaintiff for *430any cause fails to sustain his action. The provision of law is explicit on this point. “ If it appears upon the nonsuit of the plaintiff, or upon a Mai or otherwise, that the defendant is entitled to a return of the goods, he shall have judgment therefor.” Gen. Sts. c. 143, § 13. This power has been exercised where a writ has been dismissed, as in the case at bar, for want of a sufficient bond. Walbridge v. Shaw, 7 Cush. 560. Even at common law, when the plaintiff became nonsuit before the defendant had entered his plea, the latter was entitled to a return without avowry or conusance. Salkold v. Skelton, Cro. Jac. 519. Gilbert on Distresses and Replevins, 231, 280. If it were not in the power of the court to order a return in cases where a writ of replevin fails, on account of some insufficiency or irregularity, great injustice might be done under the forms of legal process. The property of a person might then be taken from him by the service of a defective writ, without affording him any judgment or process by which to regain its possession. That the defendant in the present case was entitled to a return of the goods there can be no doubt. He had a special property therein at the time they were replevied, by virtue of the attachment made by him thereon, which gave him good right to hold them as against the plaintiff. Quincy v. Hall, 1 Pick. 357, 361.
The only remaining question is, whether there is any good reason shown for the refusal of the court to exercise its power to order a.return of the property ? It seems to us that there is not. The motion was made at the same term at which the action was dismissed. No final judgment had been entered in the action. It was still within the power of the court to revoke or modify the order for dismissal, or to make any other suitable entry in the case which law and justice might require. Commonwealth v. Weymouth, 2 Allen, 144. Perhaps it would have been more regular and in accordance with practice to make the suggestion of the defendant’s right to the property replevied, and his prayer for a return in connection with the motion to dismiss, and to file it at the same time. But there is no rule which absolutely requires this to be done. And in the case at bar, as the motion for a return with an allegation of special property in *431the defendant was made at the return term of the writ, and before the time for filing an answer to the action had expired, we think it was not too late for the court to act upon it, although it were filed subsequently to the order for dismissing the action.
Exceptions sustained.