delivered the opinion of the court.
This is an action of assumpsit, brought by the appellees, Cooper & Co., against the appellants, Forbes & Bro., for the price of merchandise. The correctness of the claim is admitted by a non-denial, but the appellants sought to defeat a recovery by the. assertion of a larger claim, unliquidated in character, and for damages arising from the non-performance by the appel*287lees of a building contract made by them with the appellants. The lower court gave judgment for the appellees, having sustained a demurrer to the answer. Its averments must, therefore, be taken as true in considering this appeal. It sets forth the appellants’ claim in proper form, and avers that the appellees are non-residents, and have no property in this State. It attempts to rely upon the claim both by way of set-off and counter-claim. It is manifest it does not constitute the latter. The two claims are entirely distinct. Such a thing as a counter-claim had no existence prior to the adoption of the Code of Practice. We must, therefore, look to it alone for its' meaning. It defines it to be: “A cause of action in favor of a defendant against a plaintiff, or against him and another, which arises out of the contract or transaction stated in the petition as the foundation of the plaintiff’s claim, or which is connected with the subject of the action.” (Civil Code, section 96.)
Was it then available as a set-off? This presents the question, whether, upon the admitted facts of this case, it could be relied upon as a defense, although for unliquidated damages. The doctrine of equitable set-off existed long prior to the adoption of the Code; and it was well settled that a court of equity would apply it where the demands were connected, or where the one sought tó be set off formed the consideration of the other. The exception to this rule was that if the claim proposed to be set off was one of unliquidated damages, the court would not, on account of the connection between the demands, first liquidate the damages, and then make the set-ofiE, provided there *288was a plain, and adequate remedy at law. If, however, any fact existed calculated to impair the efficacy of the legal remedy, such as insolvency or non-residence, then the Chancellor would liquidate the demands, and make the set-off. (Taylor & Son v. Stowell, &c., 4 Met., 175.)
It was accordingly held by this court, in Williams v. Gilchrist, 3 Bibb, 49, and other cases decided prior to the adoption of our Code, and in which no extraneous circumstance was shown, such as insolvency, that an unliquidated demand could not be used as a set-off; and this was so even where such circumstance was shown, unless the demand was connected with the subject of the action. The reason for the rule' was to prevent confusion resulting from the trial of distinct matters in the same action. This, under the present practice, is frequently done, however, to prevent circuity and multiplicity of actions. Indeed, our Code of Practice, and the present mode of procedure, looks especially to this end.
Section 96 of the present Civil Code provides: “A set-off is a cause of action arising upon a contract, judgment or award in favor of a defendant against a plaintiff, or against him and another; and it can not be pleaded except in an action upon a contract, judgment or award.” This is substantially like the provision of our original Code of Practice, under which it was held, in Shropshire, &c., v. Conrad, 2 Met., 143, that a demand for unliquidated damages, although arising upon contract, could not be the subject of a set-off. In that case, while the claim attempted to be asserted as a set-off was distinct from the subject of *289the action, yet no extraneous fact, such as insolvency or the like, existed, which was likely to defeat the ends of justice, unless entire relief was afforded in the one action.
It is certainly unconscientious for an insolvent party to coerce the payment of his claim when he is owing the other party an equal or larger sum, and thus leave the ' latter remediless; nor should . a' non-resident be allowed, under like circumstances, to enforce, through the agency of the courts, the collection of his debt, and compel the other party to seek a foreign jurisdiction for relief, and then perhaps find the debtor insolvent. If the object of litigation be the attainment of justice, ‘assuredly such results should be prevented. Indeed, the doctrine of equitable set-off to the extent it was formerly applied, was based upon moral justice, and to meet such cases as the above, thus preventing wrong. It was then not uncommon to stay an insolvent or non-resident debtor in the collection of his claim until damages, to which the complainant might be entitled against him, were liquidated under the order of the Chancellor, and then apply them in satisfaction of his independent debt. In some of the -States it has been held that the resident debtor may proceed by attachment in an independent suit against his non-resident debtor, and attach the money owing by him in his own hands, and then answer his adversary by relying upon the attachment. It has, however, been held by other courts that he could not do so, because it would bring him within the rule that a party can not sue himself. .Numerous cases, however, may be found in which it *290has been, held that the party may, by injunction, stay his insolvent or non-resident adversary in the collection of his- claim until damages claimed are liquidated by a judgment, and thus gotten in form to satisfy the independent demand. Thus we see that, under the former practice, it was recognized that a non-resident or insolvent plaintiff should not, ex equo et bono, be allowed to compel payment when he was indebted to his adversary in a larger sum. It strikes the mind at first blush that a court should not lend itself to-such an end. But why the need of multiplication of remedy to prevent it? If, because the claim be independent, injunction or attachment must be resorted to until the damages as to the one can be liquidated, then we have what seems to us to be a needless multiplicity of action. The work of the court is increased,, and the parties are involved in needless expense and cost. Certainly these objections to such modes of procedure are not overcome by any confusion which could possibly arise from the consideration of two separate-matters in the same action. A, a non-resident or an insolvent, has an uncontested claim against B, and sues upon it. The latter has a larger one, founded upon contract, against A, but it is for unliquidated damages, and independent of the subject-matter of A’s action. Now, unless B can use it as a set-off, there must be at least three suits in court, granting he can be thus protected, where it seems to us one should suffice, or else he is remediless.
The object of rules of practice is to secure justice, and while we think great respect and regard should be shown for the established ones of remoter times,.. *291yet it should not be done, in the absence of a statutory rule, at the expense of justice. For this reason many of the technical rules of a former day have been either modified or altogether disregarded. Our Code of Practice does not forbid one, when sued by an insolvent or a non-resident, from using defensively an unliquidated claim, although founded upon a transaction independent of the subject of the action; and in our opinion the ends of justice dictate that he should be allowed to do so. We perceive no principle of reason, justice or policy, superior to the considerations in favor of his being permitted to do so, when the equitable circumstances exist to which we have alluded.
Judgment reversed, with directions to overrule the demurrer to the answer as amended, and for further proceedings consistent with this opinion.