delivered the Opinion of the Court.
On Junе 21, 1962, the plaintiffs, appellants, filed a complaint against the defendant, respondent lumber company, charging a private nuisance. The gist of the complaint was that plaintiffs are all residents of the City of Plains, Sanders County, Montana, and the lumber company is a Montana corporation owning land and operating a saw and planing mill оn land adjacent to the plaintiffs’ residences. The complaint alleges that all of the plaintiffs preceded the defendant in locating in Plains. It is also alleged that for the past several years the defendant has increased the size and scope of operations at the *86 plant. Plaintiffs demand damages for alleged injuries sustained to their property and persons due to loud noises, smells, smoke, sawdust, soot, dust, sparks, vibration, etc., all of which emanate from the woodworking plant and fall upon their residences. Operations are alleged to include a gang saw, chipper, burner, log peeler, planer, trimmers, kilns, machine shop, and other items of woodworking equipment.
The complaint was unverified. On July 13, 1962, defendant filed a motion to dismiss the complaint for failure to state a claim for which relief can be granted. Both parties stipulated that the motion could be determined by the court without appearance or argument. On September 19, 1962, the district judge granted defendant’s motion to dismiss on the grounds of “undue delay” and “laches.” No leave to amend the complaint was requested or granted. Thereafter, plaintiffs appealed to this court, assigning as error the dismissal for failure to state a claim and asserting that the defenses of “undue delay” and “laches” were not available in a legal action for damages. Rambur v. Diehl Lumber Company,
The dismissal was affirmed by this court on the ground that the complaint was unverified as required in section 93-3702, R.C.M.1947, and on the additional ground that the complaint failed to state a claim because of an inconsistency in the allegation of creation of a nuisance and the date of incorporation of the defendant. The complaint stated that the nuisance was created in 1952, but then contained the statement that the defendant was incorporated in 1956, hence, this court concluded it could not be responsible for the creation of a private nuisance.
On June 19, 1963, one week after the decision of this court, plaintiffs filed a second amended complaint eliminating the confusiоn concerning the date, verifying the complaint, and adding other minor changes. The defendant filed consolidated motions to dismiss this complaint on three grounds:
*87 (1) Failure to state a claim for which relief can be granted;
(2) The legal doctrine of res judicata forecloses this second action; and
(3) The legal doctrine of res judicata is аpplicable at least as to pre-June 21, 1962, the date of the filing of the first complaint.
The district judge who was called in to assume jurisdiction of the case, granted the consolidated motions to dismiss on the following grounds:
(1) Failure to state a claim for which relief can be granted;
(2) The election to stand on the pleadings and appeal therefrom with the appellate court affirming; and
(3) Rule 41, M.R.Civ.P., as interpreted by some federal courts, renders the first dismissal an adjudication on the merits.
From the judgment entered upon the order granting the consolidated motions to dismiss, the appellants appeal to this court on the following grounds:
(1) The defense of res judicata was not properly rаised by the motion to dismiss and should have been raised by a responsive pleading;
(2) Res judicata should not lie in this case since the merits have not been reached;
(3) The Supreme Court did not by the former opinion hold that the plaintiffs have no claim for which relief may be granted, but only that such was not shown by the claim as it appeared then;
(4) Rule 41(b), M.R.CivJP., doеs not necessarily foreclose them from pleading further; and
(5) The post-June 21,1962, rights of the plaintiffs ought to be preserved if res judicata applies to the first judgment.
The respondents contend that res judicata was properly before the court by the motion to dismiss, and that Rule 41(b) is applicable. The Rule 41(b) argument is that because the dismissal was not оne within Rule 41(b) and because the court did not state that it was not on the merits, the dismissal operated *88 as an adjudication on the merits and the first judgment is res judicata to this second amended complaint involving the same factual situation.
This is an amended complaint. By electing to stand on the pleadings and appealing from the order dismissing the comрlaint, the plaintiffs have not, in this case, lost the right to amend further. The language of the Supreme Court in the former review of this case, (Rambur v. Diehl Lumber Co.,
In the original complaint the court was most disturbed about the assertion of the creation and operation of a nuisance when it appeared from the record that the defendant was not incorporated until sеveral years after the alleged date the nuisance was created. The complaint in its amended form would seem to this court to be sufficient enough to permit the case to move to the merits of the claim.
Rule 15, M.R.Civ.P., provides that the complaint may be amended once as a matter of course before a responsive pleading is served. The motion to dismiss for failure to state a claim is not a responsive pleading within Rule 15(a). Keene Lumber Co. v. Leventhal, (C.C.A. 1st, 1948),
We are now brought to the issue of whether the defense of res judicata has been properly raised by the respondent. Rule 8, M.R.Civ.P., provides that res judicata is an affirmative defense and is to be pleaded affirmatively. The issue that then develops is whether the dеfendant can raise the affirmative defense of res judicata by his consolidated motions to dismiss in lieu of an answer or responsive pleading. The rule requires the several affirmative defenses to be set forth in special pleadings in order to avoid surprise to the defendant and to eliminate the sweeping ambiguity of a general denial. As nоted earlier, a motion to dismiss is not considered a responsive pleading within Rule 15. The old procedure in Montana required the defense of res judicata to be presented in the answer. See Section 93-3401, R.C.M.1947, (repealed in 1961;) and Mason, Montana Rules of Civil Procedure, 23 Mont. L.Rev. 24, 1961. The answer would still seem to be required in order to meet the requirements of Rule 8(c) in raising the defense of res judicata.
It has been held that the defense of res judicata should be .raised in the responsive pleading where it does not appear on the face of the complaint in order to support a motion for dis
*90
missal on the grounds of failure to state a claim. Stoddard v. Morrin, (D.C.D.C., 1942,)
In the instant case, appellants contend that there has been no such extrinsic evidence presented by counsel for respondent. We notice that this is true, but will refrain from commenting on this point further than to call attention to the provisions of Rule 56(c) with respect to non-use of affidavits. The record of the prior ease shows no mоre than dismissal of the complaint for failure to state a claim, and that such was affirmed by this court. The issue of res judicata is not so clear in this case that we could say that the trial court could find the defense available without an answer or responsive pleading to present the record of the former judgment plus a statement to show why it shоuld be treated as res judicata.
The purposes of our Rules of Civil Procedure are to speed up court processes and facilitate the decision of eases on their merits. On the surface the request of respondent flies in the face of this purpose because to grant the motion to dismiss on the basis of res judicata herе is to foreclose the plaintiffs from having the merits heard.
The new rules encourage disposition of cases quickly and on the merits, and it is to be considered a serious matter when a party moves to have a case disposed of on grounds other than the merits, especially when the motion is granted the case might become res judicata.
It appears from the record that respondent asked the trial court to sustain the motion to dismiss on the grounds of
*91
res judicata, and then asked that court to take judicial notice of the prior judgment. In this particular instance the trial court could properly take judicial notice of a judgment rendered by it, but we feel we should allude to the recent case of Holtz v. Babcock,
Section 93-501-1, R.C.M.1947, does not state that the district court must take judicial notice of the files or records of the same ease, and this court has not yet specifically decided that it should. It is apparent, however, from thе Kostohris case, (In re Estate of Kostohris),
The second major issue involved is whether the first judgment is res judicata to this second action.
The court in its memorandum opinion of this case has quoted from 2 Moore’s Fed. Prac. (2d ed.), § 12.09, p. 2257, to the effect that the motion to dismiss for fаilure to state a claim raises matter in bar and, if sustained without leave to plead over or amend, results in a judgment on the merits. However, this segment of Moore’s commentary on the operation of the rules deals exclusively with the summary judgment part of Rule 12(b). The 1946 amendment to the Federal Rule 12(b) added to that rule:
“If, on a motion asserting the defense numbered (6) to dismiss for failure of the pleading to state a claim upon which relief can be granted, matters outside the pleading are presented to and not excluded by the court, the motion shall be treated as one for summary judgment and disposed of as provided in Rule 56, and all parties shall be given reasonable opportunity to prеsent all material made pertinent to such a motion by Rule 56.”
Because the parties go beyond the pleadings and introduce other material under Rule 56, there is justification for Moore’s rule that it be deemed a judgment on the merits. But since this *92 procedure was not followed here the principle of res judicata as it might operate under summary judgment proceedings is not in issue. Therefore, the first judgment is not res judicata by virtue of anything pertaining to this portion of our Rule 12(b).
Another ground to support res judicata is argued to be Rule 41(b). At several points in 2B Barron and Holtzoff, Fed. Prac. and Proc., and in 5 Moore’s Fed Prac., reference is made to eases reported as holding that a motion to dismiss fоr failure to state a claim, if granted, can result in adjudication on the merits under Rule 41(b) dealing with involuntary dismissals. One such case, cited by both Judge Fenton and respondent, construes the phrase in the last sentence of Rule 41(b) “and any dismissal not provided for in this rule” as including a dismissal pursuant to Rule 12(b) for failure to state a claim. Bartsch v. Chamberlin Company of Ameriсa, Inc.,
“The place that this rule occupies in the numerical order of the rules, as part of Chapter VI, entitled Trials, rules 38-53, tends to characterize it primarily as controlling the action at or after trial.” It would seem to us that the context does demand that that part of 41(b) “and any dismissal not provided for in this rule” refers only to dismissals in Rules 38 to 53 that occur during the trial stage. In the instant case the trial stage has *93 not been reached, and, in fact there hasn’t been an answer or responsive pleading filed.
Florida, like Montana, has new procedural rules patterned after the Federal Rules. That state has recently noted the fact that there is question as to whether those federal cases like the Bartsch case are correct and fair in light of the purpose of the rules to get to the merits. In Hardee v. Gordon Thompson Chevrolet, Inc., (Fla.1963),
We see no valid reason to ignоre the characterization of Rule 41(b) by these two sound decisions. It is, therefore, our holding that Rule 41(b) has no application to a motion to dismiss for failure to state a claim under Rule 12(b).
It is generally agreed that there should not be a dismissal unless it clearly appears that the complainant has no right under any statement of facts. 1A Barron and Holtzoff, Fed. Prac. and Proe., § 356. If, however, there is a right and the plaintiff may recover on his claim if it is proven, then the complaint must be sustained and shaping of it handled by motions to strike or a *94 motion for more definite statement under Bule 12 as well as other amendatory and corrective pleadings. The attempt is to preserve the complaint no matter how shredded with alterations and amendments it may become. Such gets to the merits as quickly as possible and eliminates the numerous pleading pitfalls that plagued the parties under the former systems of civil procedure.
Therefore, because we feel that the plaintiffs had a right to amend their complaint, because there is somе doubt that the affirmative defense of res judicata was properly raised, because of our construction of Buie 41 (b), and because we do not feel the complaint fails to state a claim we reverse the dismissal and remand the case to the district court for further proceedings.
The post-1962 rights have not been treated here, for in light of our decision there is no issue on that matter.
