delivered the opinion of the court.
This is a proceeding by motion for a judgment for money, under section 3211 of the Code. The notice alleges that R. L. Portlock had given a deed of trust on certain real estate *383described in the notice to secure the payment of three negotiable notes particularly described in the notice, and that Portlock had thereafter sold and conveyed the land to the defendant who, as a part of the consideration for the conveyance, had expressly assumed the payment of said notes; that the notes had not been paid; that the real estate had been sold for the default; and that after crediting the notes with the net proceeds of sale there was still a balance due the plaintiff of $1,371, for which amount the plaintiff asked for judgment against the defendant. The notice further states that the deed from Portlock to the defendant contained the express agreement that the defendant would assume the payment of the said three notes, and that while the defendant had not' signed said deed, he had expressly assumed the payment of said notes by the acceptance of said deed, and that he had further assumed the payment of the only one of said notes still unpaid by requesting, through his counsel, and obtaining an extension of. time for the payment thereof.
At the June term of the court to which the notice was returnable, it was found that, in consequence of a defect in the return of service, it could not be docketed, but this v/as waived by counsel for the defendant, and the notice was docketed by consentí At that time defendant’s counsel had not determined whether they would defend the proceeding by motion, or apply for an injunction, and asked for a continuance.- The motion for a continuance was resisted by counsel for the plaintiff, but was granted by the court, and the cause continued to the September term. In the order of continuance leave was given to the defendant to demur or plead at any time during the then term of the court. The defendant did not demur or plead during the June term, though the court continued in session for some .days after the order was entered. When the docket was called on the first day of the September term, counsel for the de*384fendant stated in open court that unless a compromise of the case could be effected between that date and the date set for the trial, they would apply for an injunction to •restrain the prosecution of the action at law. When the case was called for trial at the September term, the defendant tendered his demurrer to the notice, a plea of nil debet, and a special plea setting up the defense that the supposed contract was not to be performed within one year and was not in writing, and hence, could not be enforced. The plaintiff objected to the reception of the demurrer and pleas on the ground that the time limit prescribed by the order of the June term had expired and it was now too late to file them. The defendant, however, insisted that he had the right to demur and plead as a matter of right, notwithstanding the order at the June term, and offered to lay the case over until a later day of the term, or continue it until the next term, if the plaintiff so desired. The plaintiff insisted on an -immediate trial and the rejection of defendant’s demurrer and pleas, and the court so ordered. This action of the court constitutes the first assignment of error by the plaintiff in error.
A very large discretion is vested in the trial courts in the matter of the time for filing pleadings and otherwise preparing a case for hearing, and when not controlled by statute, as for example under section 3288 of the Code, their action will not be set aside unless plainly erroneous. This discretion is necessary to the orderly conduct of the business of the court, and unless properly exercised would lead to unnecessary delay and confusion. Usually the proper time for a defendant to tender his defense is when the case is called on the docket, if he has not previously done so, and if, as in the instant case, he desires a continuance, he must’ not only show cause for it, but the court usually requires, as a part of the price for the continuance, that he shall make up the issue, so that there may not be further cause for *385delay when the case is again called for trial. Of course, if good cause can be shown why the issue cannot or should not then be made up, that too will be continued. But the general rule is to require the issue to be made up before the continuance is granted, and the rule is a wise one. It is not uncommon, however, for the court to grant the continuance, and, in the order granting it, to prescribe a time within which the defendant shall file his pleadings, and this is not objectionable, as it gives counsel additional time within which to prepare the pleadings, and, at the same time, by requiring the issues to be made up in advance, obviates the danger of a continuance when the case is next called for hearing.
In Va. Fire & M. Ins. Co. v. Buck & Newsom, 88 Va. 517, 518, 13 S. E. 973, it is said: “Issue was joined on the plea of non assumpsit, and the defendant company, in accordance with a practice common in the circuit courts of this State, obtained leave to file special pleas within sixty days. "The effect of granting leave to file these pleas in the clerk’s office was twofold: It gives the defendant additional time within which to plead, and it gives the plaintiff timely notice of the defense to be set up, and thus prevents surprise and delay at the succeeding terms. In these respects the practice is convenient.”.
But when such time limit has beeen prescribed, the defendant who has not complied with the order has not “the right to demur or plead as a matter of right,” but must show good cause why he has not. complied with the order of the court, and if he fails to do so, it may exclude his pleadings.
After defendant’s demurrer and pleas had been rejected, he then moved the court to dismiss the proceeding because a court of law was without jurisdiction in cases of that kind. In other words, the ground of the motion was because the court had no jurisdiction of the subject matter. The motion *386.was a proper one, and the court rightly entertained it. “By jurisdiction over the subject matter is meant the nature of the cause of action and of the relief sought; and this is conferred by the sovereign authority which organizes the court and is to be sought for in the general nature of its powers, or in authority specially conferred.” Cooper v. Reynolds, 10 Wall. 308, 19 L. Ed. 931. If not fixed by the Constitution, the legislature alone can determine of what subjects the several courts of the State shall have jurisdiction. No consent of parties can confer it, and a judgment outside of the jurisdiction so conferred is simply void. Objection for want of jurisdiction of the subject matter may be taken by demurrer, or motion, or in any way by which the subject may be brought to the attention of the court, and if not brought to the attention of the trial court, it may be taken notice of by the appellate court, ex mero motn, for the first time. South & W. R. Co. v. Smith, 104 Va. 314, 51 S. E. 824; Hanger v. Commonwealth, 107 Va. 872, 60 S. E. 67. If the court had no jurisdiction of the subject matter, then’ the motion should have been sustained and the proceeding dismissed. As the defendant did not sign the deed in which the payment of the notes was expressly assumed, but simply accepted it, his contract to pay was not a specialty, but a simple contract debt. Taylo’r v. Forbes, 101 Va. 568, 44 S. E. 888; Willard v. Wood, 164 U. S. 502, 17 Sup. Ct. 176, 41 L. Ed. 531.
The question, therefore, presented for consideration is this: If the defendant, as a part of the consideration for the purchase of the real estate from Portlock, agreed by parol to pay to the plaintiff Portlock’s notes to him, secured by a deed of trust on the land sold, can the plaintiff sue the defendant at law on that promise to recover the deficiency claimed in the notice? The objection, of course, is the want of privity of contract between the plaintiff and the defend*387ant. This is a question upon which there is great conflict of authority. Many of the cases are collected in 20 Am. & Eng. Ency. L. (2d ed.) 990-991.
The common law did not recognize merely ' equitable claims or interests, but the general rule was that every action must be brought in the name of the person whose legal right was invaded. When applied to matters of contract, the general rule was that, whether the contract was express or implied, by parol or under seal, or of record, the action must be brought in the name of the party in whom the legal interest was vested, and that this legal interest was vested in the person to whom the promise was made, and consequently that he or his privy was the only person who could sue in a court of law upon such contract. 1 Chitty PI. (5th Am. ed.) 2-5; 15 Ency. PL, 484, 499, and cases. But some exceptions to this general rule were recognized at an early day, and others have been made since. “Thus, in contracts not under seal, it has been held, for two centuries or more, that any one for whose benefit the contract was made may sue upon it; that is, if A promises Z, not under seal, but for valuable consideration, to pay B $1,000, B may in his own ñamé maintain an action against A. But where the promise is under the seal of the promisor, the common law never relaxed its requirement that the action should be brought by the promisee alone, or his personal representative, and not by any one for whose benefit, ever so expressly, the promise was made; a rule which -is particularly .inflexible where .the deed is an indenture or inter partes. Thus, if in a deed indented, ‘between A of the first part and Z of the second part/ there be contained a stipulation that Z should pay C $1,000, C can maintain no action for the money; and even if it be a deed poll, the better opinion is that at common law no action is maintainable by C.” 4 Minor’s Inst. 450-1. The last proposition, however, may be well doubted. Newberry Land Co. v. Newberry, 95 Va. 120, 27 S. E. 899.
*388In 1 Chitty PI., supra, it is further said: “When a bond or charter-party is made to A to pay him or a third person, a sum of money for the benefit of the latter, the action must be brought in the name of A, and the third person cannot sue for or even release the demand. And when a deed is made inter partes, (i. e., between A of the first part and B of the second part), C, a stranger, cannot sue either in debt or covenant on a covenant therein, though made for his benefit; but when the deed is not inter partes and reciprocal, a stranger may sue whether it be indented or. not, provided he have a legal and not a mere beneficial interest. And upon a single bond or deed poll, reciting that the obligor had received of A £40 for the use of C and D, equally to be divided, to be repaid at such a time as should be thought best for the profit of .C and D, it was decided that C and D might maintain separate actions for their respective moieties. And when a contract not under seal is made with A to pay B a sum of money, A or B may sustain an action in his own name; if, however, the promise had been to A to pay him for the use of B, A is a trustee, and B having no legal interest, cannot sue. But in some cases where a person has made a contract for the benefit of another, the latter may afterwards adopt it, and sue thereon.”
Substantially the- same language is used and the same cases cited in 2 Tuck. Com. 209.
The reason for the distinction between deeds inter partes and deeds poll is thus set out by Staples, J., in Jones v. Thomas, 21 Gratt. (62 Va.) 96, 98: “The distinction is founded on the difference in the form and'qualities of the respective instruments. A deed inter partes is an agreement under seal between two or more persons executing the same, and entering into reciprocal obligations with each other. It is a solemn declaration that all the covenants comprised in the instrument are intended to be made between these parties and none others. A deed poll on the other *389hand, is the act of a single party, and is in the nature of a declaration made by him of his intentions or obligations to some other person.”
In the last mentioned case it is further said: “In actions upon parol contracts, the rule is well established, that the party may sue thereon with whom the contract is made, or who is beneficially interested in it. When a promise is made to a person indebted to another, to pay the debt to the creditor, and the latter is a stranger to the contract and to the consideration, the party to whom the promise is made alone has the right of action thereon. A modification of this rule is to be found in a class of cases which.hold that where the debtor places money or property in the hands of a third person as a fund from which the creditor is to be paid, the latter may maintain an action against the holder of the fund. In such case a trust is created, and a promise inferred on the part of the holder, from his acceptance of the fund without objection, to pay the creditor. Ross v. Milne, 12 Leigh (39 Va.) 204 [37 Am. Dec. 646], Arnold v. Lyman, 17 Mass. R. 400, 575 [9 Am. Dec. 154] : and cases cited in 3 Rob. Prac. 18 and 19.
“In actions upon sealed instruments different principles apply. When a debt exists from one person to another and an obligation or bond is given to the debtor to discharge such debt, he alone can maintain an action for the breach of such obligation. In McAlister v. Marbury, 4 Humph. R. 426, A bound himself by covenant to pay for B certain debts due by B to C. C instituted an action of covenant against A on the instrument. It was held that he had no legal interest therein, and that an action in his name would not lie. It is laid down in 2 Tucker’s Com. 209, and the proposition is sustained by numerous authorities there cited, that when a covenant is made with A to pay him or a third person a sum of money for the benefit of the latter, the action must be brought in thé name of A; and the third person cannot even *390release the demand. See also, Millard v. Baldwin, 3 Gray’s R. 484; Watson v. Inh. of Cambridge, 15 Mass. R. 286; 3 Rob. Prac. 15.”
Such was the state of the law at the time of the revision of the general statutes of the State in 1849. The revisors, in their report to the legislature, reported a new section in the following words, to-wit: “An immediate estate or interest in, and the benefit of a condition or covenant respecting any estate, real or personal, may be taken by a person, although he be not named a party to the instrument.” Report of Revisors, Ch. 116, sec. 2, p. 601. To this the legislature added: “and if a covenant or promise be'made for the sole benefit of a person with whom it is not made, or with whom it is made jointly with others, such person may maintain in his own name any action thereon, which he might maintain in case it had been made with him only, and the consideration had moved from him to the party making such covenant or promise.” Code 1849, Ch. 116, sec. 2. But few cases originating under this statute have come to this court, and it has not been necessary to decide hoW far the statute is merely declaratory of existing law and how far it changed the common law rules above mentioned, nor is it necessary now to decide that question. It seems plain, however, that the statute applies as well to promises (though not under seal) as to covenants, and that in either case, to entitle a third person to sue thereon, the promise or covenant must have been made for his sole benefit. In the instant case the promise was not under seal. Thacker, by accepting the deed containing the express promise, agreed with Portlock to assume as a part of the purchase price, and pay to the defendant in error, the amount of debt due by Portlock to the defendant in error, and secured by a deed of trust given by Portlock on the property conveyed by the latter to Thacker. In other words, Thacker agreed with Portlock to pay off and discharge the mortgage debt of Port-*391lock to Hubard and Appleby, Inc., and the question is: Was this agreement on the part of Thacker a promise for the sole benefit of Hubard & Appleby, Inc.? The answer would seem to be manifest. In Simpson v. Brown, 68 N. Y. 355, it is said: “It is not every promise made by one to another, from the performance of which a benefit may inure to a third, which gives a right of action to such third person, he being neither a privy to the contract nor to the consideration. The contract must be made for his benefit as its object and he must be the party intended to be benefited.” Where the contract was entered into primarily for the benefit of the parties thereto, the mere fact that a third person would incidentally derive a benefit from its performance does not entitle him to sue for a breach thereof. Stuart v. James River & K. C. Co., 24 Graft. (65 Va.) 285; McIlvane v. Big Stony L. Co., 105 Va. 613, 620, 54 S. E. 473; Lake Ontario Shore R. Co. v. Curtiss, 80 N. Y. 219; Kountz v. Holthouse, 85 Pa. 235; Wright v. Terry, 23 Fla. 160, 2 So. 6; Pollock on Contracts (Williston), pp. 244, 256.
We might perhaps safely rest the decision of this case upon this construction of our statute, but, even independent of the statute, or treating it as merely declaratory of the existing law as to parol contracts, as probably intended, the defendant in error cannot maintain an action at law against the plaintiff in error, on the assumption of the payment of its debt, though it had a full and complete remedy in equity. In National Bank v. Grand Lodge, 98 U. S. 123, 25 L. Ed. 75, it was held that a contract by which the Grand Lodge, for a consideration moving from another corporation, agreed with it to assume the payment of its bonds, would not support an action against the Grand Lodge by a holder of such bonds; and Mr. Justice Strong, delivering the judgment, after observing that the contract was made between and for the benefit of the two corporations, that the holders of the bonds were not parties to it, and that there was no *392privity between them and the Grand Lodge, said: “We do not propose to enter at large upon a consideration of the inquiry how far privity of contract between a plaintiff and a defendant is necessary to the maintenance of an action of assumpsit. The subject has been much debated, and the decisions are not all reconcilable. No doubt, the general rule is, that such a privity must exist. But there are confessedly many exceptions to it. One of them, and by far the most frequent one, is the case where, under a contract between two persons, assets have come to the promisor’s hands or under his control, which in equity belong to a third person. In such a case it is held that the third person may sue in his own name. But then the suit is founded rather on the implied undertaking the law raised from the possession of the assets, than on the express promise. Another exception is where the plaintiff is the beneficiary solely interested in the promise, as where one person contracts with another to pay money or deliver some valuable thing to a third. But where a debt already exists from one person to another, a promise by a third person to pay such debt being primarily for the benefit of the original debtor, and to relieve him from liability to pay it (there being no novation), he has a right of action against the promisor for his own indemnity; and if the original creditor can also sue, the promisor would be liable to two separate actions, and therefore the rule is that the original creditor cannot sue. His case is not an exception from the general rule that privity of contract is required.”
This case was cited with approval in Keller v. Ashford, 133 U. S. 610, 620, 10 Sup. Ct. 494, 496 (33 L. Ed. 667), a case very similar to the instant case, in which it was said, amongst other things: “Upon the question whether the mortgagee could sue at law, there is no occasion to examine the conflicting decisions in the courts of the several States, because it is clearly settled in this court that he could not.” *393The ground of the refusal of a right of action at law is the want of privity of contract, but even “in equity, as at law, the contract of the purchaser to pay the mortgage, being made with the mortgagor and for his benefit only, creates no direct obligation of the purchaser to the mortgagee.”
Of course, no agreement between the mortgagor and his grantee that the latter shall assume the mortgage debt, can change the relations of the mortgagor and mortgagee, and require the latter to treat the mortgagor as a mere surety for the debt, without the assent of the mortgagee (Shepherd v. May, 115 U. S. 505, 511, 6 Sup. Ct. 119, 29 L. Ed. 456), but when the assent of the mortgagee has been given, equity, by a quasi subrogation, and in order to avoid a multiplicity of suits, gives to the mortgagee the benefit of all the collateral obligations for the payment of the debt which the surety (mortgagor) holds for his indemnity. This right of the mortgagee is not the result of any contract between the grantee with the mortgagee, or with the mortgagor for his benefit, nor of .any original equity residing in him. “He is allowed by a rule of procedure, to go directly as a creditor against the person ultimately liable, in order to avoid a circuity of action, and save the mortgagor, as the intermediate party, from being harrassed for the payment of the debt, and then driven to seek relief over against the person who has indemnified him, and upon whom the liability will ultimately fall. The equity on which this relief depends is the right of the mortgagor against his vendee, to which he is permitted to succeed by substituting himself in the place of the mortgagor.” Crowell v. St. Barnabas Hospital, 27 N. J. Eq. (12 C. E. Green), 655, 656; Keller v. Ashford, 133 U. S. 610, 624-5, 10 Sup. Ct. 494, 33 L. Ed. 667. The same conclusion is reached in an able opinion by Cardwell, J., in McIlvane v. Big Stony L. Co., 105 Va. 613, 54 S. E. 473, a case very similar to the instant ease, and in which the prior Virginia cases are reviewed and discussed.
*394The following cases in this State bearing on this question are given for convenience of reference: Ross v. Milne, 12 Leigh (39 Va.) 204, 37 Am. Dec. 646; Vanmeters v. Vanmeters, 3 Gratt. (44 Va.) 148; Jones v. Thomas, 21 Gratt. (62 Va.) 96; Stuart v. James River & K. C. Co., 24 Gratt. (65 Va.) 294; Willard v. Worsham, 76 Va. 392; Osborne v. Cabell, 77 Va. 462; Taliaferro v. Day, 82 Va. 79; Francisco v. Shelton, 85 Va. 779, 8 S. E. 789; Tatum v. Ballard, 94 Va. 370, 26 S. E. 871; Ellett v. McGhee, 94 Va. 377, 26 S. E. 874; Newberry Land Co. v. Newberry, 95 Va. 120, 27 S. E. 899; Cosmopolitan Life Ins. Co. v. Koegel, 104 Va. 619, 52 S. E. 166; Casselman v. Gordon, 118 Va. 553, 88 S. E. 58.
Counsel for the defendant in error insists that the right to maintain this action at law is sustained by Cosmopolitan Life Ins. Co. v. Koegel, supra; but the facts of that case do not warrant the conclusion. In that case, the Royal Tribe of Joseph, a benefit society without stockholders, desired to go out of business as a separate entity, and to consolidate with the Cosmopolitan Life Insurance Company, and in order to effect this object and fully protect its members, who were entitled to its assets, it entered into an agreement with the insurance company whereby it transferred to that company all of its assets of every kind and its business and good will, and, in consideration of such transfer, the insurance company, among other things, assumed “all liabilities of the said Royal Tribe of Joseph of certificates of membership upon which death had been reported, and which were at the date of said contract unpaid.” At the date of the contract, the death of Doegel, a member of the Royal Tribe of Joseph, had been reported and the policy on his life remained unpaid. An action was brought by the beneficiary against the insurance company, and the defense of want of privity was set up by the company, but the plaintiff recovered judgment for the amount of the *395policy in the trial court, and that judgment was affirmed by this court. Upon this point, Cardwell, J., delivering the opinion of the court, said: “But the defendant insists that as the plaintiff is a stranger to the consideration for which that promise and agreement was made, she cannot maintain this action, and that it could be maintained by the Royal Tribe of Joseph alone—this upon the theory that there must be a privity between the plaintiff and defendant in order to render the defendant liable to an action by the plaintiff on the contract. This is undoubtedly the general rule; but it has its exceptions like many other general rules. ”
He then proceeds to discuss the subject, and distinctly places the right of recovery on the ground of the well established exception to the general rule, that wherever one person has in his hands money equitably belonging to another, that other person may recover it by assumpsit for money had and received. In such case, it is said, the law creates the privity and implies the promise necessary to support the action. This exception is of long standing and is as well established as the rule itself.
In the Koegel Case, Cardwell, J., uses the following language: “In the one class of cases the principle is applied where it is money that the defendant has which equitably belongs to the plaintiff, and in the other where the defendant has either money or property in consideration of which he has promised to pay the debt due the plaintiff by his debtor, from whom the defendant acquired such money or property, and to whom the promise was made, and in either case the law creates the privity and implies the promise necessary to support an action on the part of the plaintiff to recover his debt of the defendant.”
The rule and the modification thereof is well stated by Staples, J., in Jones v. Thomas, 21 Gratt. (62 Va.) 96, 101, hereinbefore quoted.
*396In the instant case there was no property or money in the hands of the grantee. The property had been sold to pay the mortgage debt, and the action was brought to recover the deficiency.
The same rule is stated in 15 Ency. PI. & Pr. 514, citing many cases. See also, National Bank v. Grand Lodge, supra.
In Baltimore & Ohio R. Co. v. Burke, 102 Va. 646, 47 S. E. 825; Keith, P., uses this language: “If the defendant has money in his possession which in good conscience he ought to pay to the plaintiff, the law will imply a promise upon the part of the defendant to do his duty, and to pay the money; and this implied promise is as effectual to create privity between the parties as an express promise would be.”
On the other hand, it is said that where the contract is primarily for the benefit of the parties thereto, .the mere fact that a third person would be incidentally benefited does not give him a right to sue for its breach. Where the right of the creditor is derivative only, his remedy is in equity and not at law. Simson v. Brown, supra; Willard v. Wood, 135 U. S. 309, 10 Sup. Ct. 831, 34 L. Ed. 210; Davis v. Calloway, 30 Ind. 112, 95 Am. Dec. 671; Williston’s Contracts, 260; 15 Ency. Pl. & Pr. 516 and cases cited.
Whether or not Thacker was principal or surety for the debt, and, if surety only, whether he was released by giving time to' the principal without his consent, cannot be considered. This wás a motion to dismiss for want of jurisdiction of the subject matter, and matters,affecting the merits of the case cannot be considered.
We are of opinion that a court of law is without jurisdiction in the premises, and for that reason the judgment of the circuit court must be reversed, but without prejudice to the appellee to assert any claim it may have in a court of equity.
Reversed.