This is an appeal from an order of the Superior Court denying the defendant’s motion to dismiss the action on the ground that the defendant is a foreign corporation and that there has been no service upon it or attachment of its property. The service was made upon Mr. Charles A. Jewell as *370the defendant’s attorney. If we may trust the defendant, for the slipshod papers do not give us the dates, this motion to dismiss followed, and the plaintiffs then amended their writ by inserting an allegation that the defendant was a foreign corporation and was plaintiff in a former action in the same court against the present plaintiffs, and that said Charles A. Jewell was the attorney of the plaintiff in the former suit. Afterwards this motion was brought up and was overruled.
It is provided by Pub. Sts. c. 164, § 2, that if a person, who is not an inhabitant of this Commonwealth and who cannot be found here to be served with process, brings an action, he shall be held to answer to any action brought against him by the defendant, if the demands in the two cases are of such a nature that the judgments or executions can be set off against each other. It is further provided, by § 4, that the writ in the cross action may be served on the person who appears as the attorney •of the plaintiff in the original suit. The plaintiff relies upon ■■these provisions. The defendant denies that the act applies to 'foreign corporations, suggests that it is unconstitutional under .the fourteenth amendment of the Constitution of the United 'States, that the judgments are not of a nature to be set off against each other, and sets up some other subordinate matters •which we shall mention so far as necessary.
We see no reason to doubt that the act applies to foreign cor•porations. The grounds of convenience which led to the enactment are as strong in the case of corporations as when natural •persons come here to sue, and the word “ person ” is sufficient to include them. Pub. Sts. c. 3, § 3, cl. 16.
We should have seen equally little reason to doubt the con,-stitntionality of the act, were it not for a slight ambiguity in some of the expressions in Dewey v. Des Moines, 173 U. S. 193. In that case the plaintiff, a resident of Illinois, filed a petition to set aside certain assessments of land in Iowa belonging to him. A counter claim was set up for a sale of the land under the lien for the assessment, and also for a personal judgment. The Supreme Court of .the United States held, very naturally, that the Iowa law, so far as it undertook to impose a liability upon a non-resident in excess of the benefit to his land, p. 201, or indeed a personal liability at all, pp. 202, 204, was invalid. That, *371as we understand the case, is all that is decided or intimated. It is said that “ by resorting to the State court to obtain relief from the assessment and from any personal liability provided for by the statute, the plaintiff did not thereby in any manner consent, or render himself liable, to a judgment against him providing for any personal liability.” Of course he did not, because there was no such liability; but we do not understand the court to mean that where the liability exists, a plaintiff by resorting to the courts of a State may not consent to counter process which may result in a judgment. We do not understand the court to have had any such question in mind.
We need not refer to the often repeated assertion of the right of the States to determine the conditions upon which foreign corporations shall be permitted to do business within their jurisdiction. Hooper v. California, 155 U. S. 648, 652. Commonwealth v. Nutting, 175 Mass. 154. We come nearer to the case when foreign insurance companies are required by statute to appoint an attorney for the service of process. There is no doubt of the validity of such statutes. Lafayette Ins. Co. v. French, 18 How. 404. St. Clair v. Cox, 106 U. S. 350, 356. Gillespie v. Commercial Ins. Co. 12 Gray, 201. Smith v. Mutual Ins. Co. of New York, 14 Allen, 336, 340. Johnston v. Trade Ins. Co. 132 Mass. 432, 435. Gibson v. Manufacturers Ins. Co. 144 Mass. 81. In the first of these cases it was held that jurisdiction was acquired by service on the resident agent of a foreign company, by force of a State law that such an agent making contracts within the State should also be deemed agent to receive service of process in suits founded upon such contracts. The Supreme Court, speaking through Mr. Justice' Curtis, said that when the company sent its agent into the State with authority to make contracts of insurance, then it must be taken to assent to the condition upon which alone such business could be done there. So here. The foreign company by employing an attorney to begin an action against the defendant in Massachusetts, thereby assents to the attorney’s receiving service in a counter suit, and gives him such powers as make the service sufficient. See further Nations v. Johnson, 24 How. 195.
We agree that the analogy which we have suggested is not perfect, but, if it is not sufficient, still we cannot bring ourselves *372to doubt the validity of the statute in question. If a State law provided that in all cases all cross demands should be open, an entirely possible piece of legislation, no one would doubt the constitutionality of the law. No service would be necessary in order to entitle the defendant to judgment if on a general taking of accounts he came out ahead. We do not suppose that the legislation would be any worse if it made service of a writ on the plaintiff’s attorney a condition of the cross judgment. We do not perceive why the law would not be equally good if confined to foreigners suing in this State, the ground of the discrimination being obvious and reasonable.
The other objections may be dealt with very shortly. If the plaintiffs recover a judgment, that judgment will be for a definite sum, and is none the less proper for set-off that the cause of action was for unliquidated damages. Nothing appears on the record before us with regard to several matters touched in the plaintiffs’ brief. If it be true as alleged that the Superior Court refused to order a continuance of the original action under § 5, that is not an adjudication that the judgment will not be proper to be set off when reached. Moreover, the decision may have gone on grounds having nothing to do with the question. If it be true as alleged that the claim in the original action has been satisfied since the service of the cross writ, the fact cannot affect the jurisdiction after it has attached. The writ did not need to be served over again after the amendment showing that the mode of service adopted was justified by the facts. See Converse v. Damariscotta Bank, 15 Maine, 431; Hearsey v. Bradbury, 9 Mass. 95; Hart v. Waitt, 3 Allen, 533. The justification lay in the facts, not in the allegation of the facts, and the allegation was necessary, if at all, only to show on the face of the record that the case was within the statute.
Motion denied.