Preston, J.
The return of the defendant judge shows the following facts: Plaintiff brought an action for $50 for balance due on rent and for waste. A writ of attachment was issued, under which property was levied upon, and a delivery bond given. On September 5, 1912, plaintiff, by his attorneys, in open court, dismissed said cause without prejudice and paid all costs, before any answer or counterclaim had been filed. Defendants objected to such dismissal, and gave notice verbally that they would file a counterclaim and insist on the trial thereof. Afterwards, on September 6th, defendants filed their answer and counterclaim, in which they deny being indebted to plaintiff, and ask damages for the wrongful suing out of the attachment. One of the items of damage in said counterclaim was a claim for $150 for expenses of defendants from Montana to Iowa in attending said trial. On September 11th trial was had on said counterclaim, and a judgment rendered against plaintiff for $350; plaintiff having failed and refused to appear or file any further pleadings. The findings of the court are, in part, as follows: “. . , That when this action was commenced neither of the defendants were indebted to plaintiff in any sum whatever. That *203at the time the action was commenced defendants were preparing to move to the state of Montana. That a portion of their goods was already loaded in cars, which was known to plaintiff, and this cause was commenced by plaintiff, with the view and expectation that he could and would thereby compel defendants to pay him the amount specified in his petition rather than return from Montana to contest the same. And the court further finds: That when plaintiff instituted this action he also commenced a criminal proceeding against defendant, William Bunch, and that he failed to prosecute such action. That said criminal proceeding was commenced by plaintiff for the wrongful purpose of inducing the defendant Bunch to pay said money. That said William Bunch incurred expense in the sum of $150 in returning from Montana to defend said action. That defendants were entitled to judgment against plaintiff for the expenses so incurred in the sum of $150, and the additional sum of $200 as damages for the wrongful and malicious suing out of said attachment.” A further finding of the court reads: “The court concluded that, as said action and proceedings were not commenced or prosecuted in good faith, but for the purpose alone of compelling defendants to pay said sum of money rather than return from the state of Montana to defend the same, and as said plaintiff has caused defendants to incur said expense of $150 in attending this term of court, plaintiff could not dismiss his action in such manner or to such extent as to prevent the court from entering judgment in favor of the defendants for the amounts above stated.”
1. Actions: dismissal: counterclaim: jurisdiction. I. We think the court was without jurisdiction to render judgment on the counterclaim. The attorneys for defendant, in argument, say that ordinarily the dismissal of an action before the defendant has filed a counterclaim will prevent defendant from filing a counterclaim therein; but they say there are two questions which they desire to suggest: First, can plaintiff take advantage of this rule of practice to consummate a *204fraud; and, second, did not the district court have the right to tax to plaintiff the $150 which he compelled defendant to expend in attending court in this case? It is not a question here as to whether plaintiff practiced a fraud on said defendants Bunch, but it is a question of jurisdiction. Plaintiff had the right to dismiss his action. Code, section 3764. Section 3766 of the Code provides: “In any case when a counterclaim has been filed, the defendant sháll have the right of proceeding to trial thereon, although the plaintiff may have dismissed his action or failed to appear.” In Page v. Sackett, 69 Iowa, 226, defendants filed a counterclaim after plaintiffs had dismissed their action, which was stricken on motion of plaintiffs. In that case the eourt said: “But the provision (of the Code) surely was not intended to authorize the trial of new causes of action, in favor of the defendant, not set up before the dismissal. The provision clearly contemplates the trial of a counterclaim pleaded before the dismissal of the action and reaches no further. It does not contemplate that the defendant may, by pleadings subsequent to the dismissal, introduce causes of action not before involved in the case.” See, also, Bardes v. Hutchinson, 113 Iowa, 610; Holmes v. Hull, 48 Iowa, 177. The fact that defendants objected to the dismissal and gave notice that they would thereafter file a counterclaim is not material. Plaintiff had the right to dismiss, and when he did dismiss he was out of court.
2 Same: attachment: counterclaim: costs. In regard to defendants’ second question as to the right of the court to tax the $150 to plaintiff, it is urged that in view of the facts the court had authority to render judgment against plaintiff for costs of this case, and that *n view this fact the court had the right to treat this action as not brought or prosecuted in good faith, but for an illegal purpose, and hence plaintiff could not use said statute to perpetrate a fraud; that the court, having the power to render judgment for costs, could treat the $150 which plaintiff compelled *205defendants to expend in attending said court as a part of the costs; and that the judgment should be sustained as to that amount. But no reasons are given why this should be so. We are unable to see upon what theory defendants’ counsel can make such a claim. The $150 item was in no sense costs. If the Bunches had been witnesses only, their mileage could have been taxed as a part of the costs if the court had so ordered at the proper time. But they were parties to the action. It could be set up by said defendants as an item of damage in an action on the attachment bond, and can be, even now, in an independent action on the bond. Further than this, the record shows that said defendants did plead this item in their counterclaim, and the court in his judgment allowed them therefor, not as costs, but as an item of damage.
3. Certiorari. II. The judgment being void for want of jurisdiction, certiorari is the proper remedy. Bardes v. Hutchinson, 113 Iowa, 610; Davis v. Preston, 129 Iowa, 670. The judgment of the district court must be, and it is, annulled.
4. Same: costs. III. It is claimed by plaintiff that the costs of this proceeding should be taxed to the defendants in the court below, William Bunch and Mrs. William Bunch. The defendant judge is, of course, not liable for costs. The defendants Bunch are not perhaps, in one sense, parties to this proceeding; but the attorneys for the defendant judge are the same attorneys who appeared in the court below for the defendants Mr. and Mrs. Bunch, and they are in this court seeking to sustain the judgment in favor of the said defendants. Under such circumstances, it has been held that they are the real parties in interest, and that the costs of this proceeding should go against them. Tiedt v. Carstensen, 64 Iowa, 131. 6 Cyc. 837. As bearing somewhat upon this question — that is, to the effect that the defendants in the court below were not necessary parties to this proceeding and that notice óf this proceeding is not required to be had on them — see Davis v. Preston, 129 Iowa, 670.
*206The judgment of the district court is annulled, and the costs of this proceeding will be taxed to William Bunch and Mrs. William Bunch.