Per Curiam.
The defendant has appealed from an order setting aside a stipulation dismissing the action, -and from an order refusing to change the place of trial. The two appeals were argued at the same time and will be considered in one opinion. The defendant is a South Dakota corporation, engaged in mining coal at Haynes, in Adams county, in this state. On or about December 23, 1920, the plaintiff commenced this action in the district court of Hettinger county, seeking to recover damages in the sum of $50,000 for certain personal injuries- which he claimed he had sustained on or about February 20, 1920, while employed as a laborer in th.e coal mine operated by the defendant coal company near Haynes in Adams county, The case was afterwards transferred to the federal court, but on application of the plaintiff it was remanded *940to the district court of Hettinger county. On November 14, 1921, certain negotiations were had between a representative of the defendant and the plaintiff relating to a settlement' of the action, with the result that the defendant company paid the plaintiff $200 in cash, and agreed to pay, and later paid, hospital bills aggregating $175. And the plaintiff executed and delivered to the defendant a release in full of all claims. On that same day the parties entered into a written stipulation whereby it was stipulated that the action be dismissed with prejudice. This stipulation was filed in the office of the clerk of the district court of Hettinger county. On December 6, 1921, the plaintiff, pursuant to notice, applied to the district court for an order vacating the settlement and the stipulation of dismissal and reinstating the cause upon the calendar for trial. A hearing was had on this motion at which certain affidavits were submitted and witnesses also testified orally. The trial court thereupon made an order to the effect that—
“The stipulation dismissing the above-entitled action and the release and settlement signed by the plaintiff on or about the 14th day of November, 1921, be and they are hereby vacated, set aside and held for naught; and the above-entitled action stand on the calendar for trial for the term of court now convened, and that the same be tried in its regular order on the calendar.”
On December 10, 1921, the defendant moved the court that the place of trial be changed from the county of Hettinger to the county of Adams. This motion was denied.
On the oral argument it is contended that the order setting aside the stipulation of dismissal is not an appealable order. No motion was made to dismiss the appeal on this ground, and the objection was presented for the first time on the oral argument. We are of the opinion, however, that the order is one which “involves the merits of an action or some part thereof,” and hence is appealable under subdivision 4 of § 7841, C. L. 1913. That is the specific holding of the Supreme Court of Minnesota under a statute identical in terms with that-quoted above. Rogers v. Greenwood, 14 Minn. 333 (Gil. 256); Bingham v. Board of Supervisors, 6 Minn. 136 (Gil. 82). The Supreme Court of Wisconsin, in Brown v. Cohn et al., 88 Wis. 627, 60 N. W. 826, considered and determined on the merits an appeal from an order relieving a party from a stipulation waiving a jury trial. In Northern Pac. R. Co. v. Barlow, 20 N. D. 197, 126 N. W. 233, Ann. Cas. 1912C, 763, this court ruled that an order which s'et aside findings of facts and relieved the parties *941from a stipulation on which the case was submitted was appealable. See, also, Bolton v. Donavan, 9 N. D. 575, 84 N. W. 357. It is contended by the appellant that there was not sufficient showing to justify the trial court in setting aside the stipulation of dismissal. While we deem the question to be a close one, we are not prepared to say that the trial court erred in setting aside the stipulation of dismissal so as to afford the parties an opportunity to try the cause on its merits. See 36 Cyc. 1295. The order entered by the trial court, however, went much further than this. It set aside not only the stipulation of dismissal but the compromise of the cause of action itself and the release of damages executed by the defendant. This was clearly outside of the functions of the court on the motion and outside of the matter properly submitted for the determination of the court on such motion. While the court has power to set aside stipulations in any case pending before it, and ought to do so if all causes w'here it would be inequitable to enforce the stipulation (36 Cyc. 1294, 1295), the court may not, upon motion, set. aside the compromise of the cause of action itself (36 Cyc. 1296). The question as to the validity of a compromise goes to the very existence of the cause of action itself, and ought not to be determined in a summary manner upon motion. In fact, on the presentation of this appeal it was not seriously contended by the plaintiff that the validity of the compromise was a matter properly determinable by the trial court on the motion; and it was argued that the order of the trial court was not intended to, and did not have, any such effect. It was contended that the only effect of the order was to set aside the stipulation of dismissal and to enable the parties upon the trial .to have determined on its merits the question of whether the cause of action itself had in fact been compromised between the parties. That contention, however, is not in accord with, but directly contrary to, the language of the order appealed from. Hence we are of the opinion that the order setting aside the stipulation of dismissal and the settlement or compromise of the cause of action should be modified so as to provide merely that the stipulation of dismissal be set aside; and that the defendant, if it so desires, be afforded permission to serve and file a supplemental answer setting forth as a defense the alleged compromise of the cause of action.
In support of the application for a change of the place of trial, the defendant submitted several affidavits, including the affidavit of the president of the defendant company and that of its attorney, and one Dewey, a former county judge of Hettinger county. Many of these *942affidavits tend to show that for various reasons the defendant cannot have a fair and impartial trial in the county of Hettinger. The affidavits, and the facts of which the court takes judicial notice further show that the plaintiff is a resident of the county of Adams; that the mine in which the alleged injuries are claimed to have been sustained was located near Haynes in Adams county, a distance of about 8.2 miles from Hettinger, the county seat of Adams county; that Hettinger and Haynes are located on the same line of railway; that Mott, the county seat of Hettinger county, is located on a different line of railway some 36 miles from Haynes. The affidavits show that all of the witnesses for both the plaintiff and the defendant, with one or two possible exceptions, reside in the county of Adams, and are from 20 to 40 miles nearer to Hettinger in Adams county than to Mott in Hettinger county; that the defendant has'in all some 18 witnesses, who are named in the affidavits, • and all of whom, with one exception, are residents of Adams county; that the other witness is one Dr. Murdy of Aberdeen, S. D., who will find it much more convenient to come to Hettinger than to Mott. The location of Hettinger, the county seat of Adams county, Mott, the county seat of Hettinger county, and Haynes, where the accident occurred, are shown on the following map:
*943The oral testimony (adduced upon the hearing of the motion to set aside the stipulation of dismissal) show's that the alleged injury sustained by the plaintiff was received in the coal mine at Haynes, and that after the injury plaintiff was taken first to a hospital at Hettinger and treated by one Dr. Mordoff, who is still residing there; that later on he was taken to a hospital at Aberdeen, S. D. The undisputed evidence also shows that the settlement or compromise in controversy was perfected at Haynes and that the plaintiff resides only a relatively short distance from that town. When the showing made by the defendant is considered in light of the facts of which the court takes judicial notice (such as the location of cities and villages and distances between two or more cities or villages), it would seem that the convenience of witnesses would be greatly promoted by changing the place of trial from Hettinger to Adams county. The record, however, discloses that upon the hearing of the motion the plaintiff interposed what he denominated a “demurrer” or a general objection to the sufficiency of the moving affidavits, coupled with a request that in event the demurrer or objection was overruled that he be afforded an opportunity to present counter affidavits. The trial court in effect sustained the objection. It seems that in so doing he ignored the ground that the convenience of witnesses would be promoted by changing the place of trial, and considered merely the ground that there was reason to believe that an impartial trial could not be had in the county in which the action was brought, for, in denying the motion, the trial judge said that he could not “agree with counsel for the defendant that he cannot have a fair and impartial trial here,” i. e., in Hettinger county. Under the statute, a change of place of trial ought to be granted either when there is reason to believe that an impartial trial cannot be had in the county from which the change is asked, or when the convenience of witnesses and the ends of justice would be promoted by the change. Section 7418, C. L. 1913.
Hence the order denying a change of place of trial is reversed, and the trial court is directed to fix a date for hearing the motion and to afford both parties reasonable opportunity to present such other showing as they may desire. Costs of both appeals will abide the final judgment in the action.
Grace, C. J., and Birdzell, Bronson, Christianson and Robinson, jj., concur.