
659 F.3d 1212 (2011)
Allen THATCHER, Individually and as a Class Representative on Behalf of all Similarly Situated Persons, Plaintiff-Appellee,
v.
HANOVER INSURANCE GROUP, INC.; Massachusetts Bay Insurance Company, Defendants-Appellants.
No. 11-1610.
United States Court of Appeals, Eighth Circuit.
Submitted: September 22, 2011.
Filed: November 4, 2011.
Stephen Edward Goldman, argued, Hartford, CT, R.T. Beard, III, Lyn Peoples Pruitt, Little Rock, AR, John B. Greer, III, Texarkana, TX, on the brief, for appellant.
Derrick Lee Morton, argued, Edmond, OK, D. Matt Keil, John Clinton Goodson, Texarkana, AR, James Pratt, Jr., Camden, AR, Brad E. Seidel, Daingerfield, TX, Douglas A. Terry, Jason Ernest Roselius, Edmond, OK, Timothy Chad Hutchinson, Rogers, AR, on the brief, for appellee.
Before WOLLMAN, BYE, and SHEPHERD, Circuit Judges.
*1213 SHEPHERD, Circuit Judge.
Plaintiff Allen Thatcher filed a putative class action in Arkansas state court against Defendants Hanover Insurance Group, Inc. and Massachusetts Bay Insurance Co. asserting causes of action for unjust enrichment, fraud, constructive fraud, and breach of contract. After Defendants removed the case to federal district court pursuant to the Class Action Fairness Act (CAFA), 28 U.S.C. § 1332(d), Thatcher sought permission to voluntarily dismiss his case without prejudice so that he could refile an amended complaint in state court that would avoid federal jurisdiction. The district court granted Thatcher's voluntary motion to dismiss without prejudice.
Defendants now appeal the district court's decision, arguing that the district court should have considered whether the motion to voluntarily dismiss was an improper forum-shopping measure. We agree and therefore reverse the district court's dismissal and remand for consideration of the issue.

I
On October 28, 2010, Thatcher filed an amended complaint against Defendants in the Circuit Court of Miller County, Arkansas. Thatcher's amended complaint included a putative class action that claimed that Defendants failed to properly pay insureds for general contractors' overhead and profit under the terms of their insurance policies.
On November 30, 2010, Defendants filed a notice of removal, asserting federal jurisdiction under CAFA. On December 7, 2010, Defendants filed their answer in the district court. That same day, Thatcher filed a notice of voluntary dismissal. However, because Defendants had already filed an answer, permission from the court was necessary for voluntary dismissal. See Fed.R.Civ.P. 41(a)(2). Accordingly, Thatcher requested leave to voluntarily dismiss his complaint without prejudice so that he could refile his case as a breach of contract action in state court. After receiving briefing on the issue from both sides, the district court granted Thatcher's motion and dismissed the complaint without prejudice.

II
After "the opposing party serves either an answer or a motion for summary judgment . . . an action may be dismissed at the plaintiff's request only by court order, on terms that the court considers proper." Fed.R.Civ.P. 41(a)(1) & (2). "A district court's decision to allow a plaintiff to dismiss a case voluntarily is reviewed for abuse of discretion." Crawford v. F. Hoffman-La Roche Ltd., 267 F.3d 760, 763 (8th Cir.2001). "An abuse of discretion. . . can occur in three principal ways: when a relevant factor that should have been given significant weight is not considered; when an irrelevant or improper factor is considered and given significant weight; and when all proper factors, and no improper ones, are considered, but the court, in weighing those factors, commits a clear error of judgment." Kern v. TXO Prod. Corp., 738 F.2d 968, 970 (8th Cir. 1984).
Our Court has previously opined on the considerations to be taken into account by a district court prior to dismissing under Rule 41(a)(2):
A decision whether to allow a party to voluntarily dismiss a case rests upon the sound discretion of the court. In exercising that discretion, a court should consider factors such as whether the party has presented a proper explanation for its desire to dismiss; whether a dismissal would result in a waste of judicial *1214 time and effort; and whether a dismissal will prejudice the defendants. Likewise, a party is not permitted to dismiss merely to escape an adverse decision nor to seek a more favorable forum.
Hamm v. Rhone-Poulenc Rorer Pharm., Inc., 187 F.3d 941, 950 (8th Cir.1999) (internal citations omitted). In the instant case, several of the factors support the decision of the district court. The motion to dismiss came at the outset of the action, so little judicial time and effort had been expended. Likewise, any prejudice to defendants was limited because the case had not progressed beyond the pleading stage. See Brown v. Baeke, 413 F.3d 1121, 1124 (10th Cir.2005) ("Prejudice does not arise simply because a second action has been or may be filed against the defendant, which is often the whole point in dismissing a case without prejudice." (internal citation omitted)).
At the same time, however, the district court failed to address Thatcher's purpose in seeking to voluntarily dismiss. If the trial court had done so, it could have concluded that Thatcher was dismissing so he could return to the more favorable state forum. Thatcher's expressed intent was to amend his complaint in order to avoid federal jurisdiction. See Pl.'s Mot. to Dismiss Without Prejudice and Br. in Supp., J.A. at 105 ("To alleviate any confusion concerning the claims set forth in Plaintiff's Complaint, Plaintiff is seeking the current dismissal so he can re-file his Complaint in the Circuit Court of Miller County asserting a breach of contract claim only."). This reading of Thatcher's purpose is supported by his failure to consider the effects of his actions on the putative class that he purportedly represents. In the original complaint, Thatcher included claims for unjust enrichment, fraud, constructive fraud, and breach of contract. In his motion to dismiss without prejudice, Thatcher set forth his intention to refile this matter in state court as a breach of contract claim only. Thatcher set forth no adequate reason why it would benefit the class to abandon these additional claims.
In addressing whether a district court should allow voluntary dismissal, we have repeatedly stated that it is inappropriate for a plaintiff to use voluntary dismissal as an avenue for seeking a more favorable forum. See, e.g., Cahalan v. Rohan, 423 F.3d 815, 818 (8th Cir.2005) ("A party may not dismiss simply to . . . seek a more favorable forum."). In the removal context, this rule coincides with other measures which "strike a balance between the plaintiff's right to select a particular forum and the defendant's right to remove the case to federal court." Knudson v. Sys. Painters, Inc., 634 F.3d 968, 976 (8th Cir. 2011). For example, under the fraudulent-joinder exception, a plaintiff cannot defeat a defendant's right of removal by "fraudulently joining a defendant who has no real connection with the controversy." Id. (citation omitted). Likewise, under the St. Paul Mercury rule, in a diversity action a plaintiff may not merely amend his complaint after removal to claim damages below the jurisdictional amount and deprive the federal court of jurisdiction. St. Paul Mercury Indem. Co. v. Red Cab Co., 303 U.S. 283, 292, 294, 58 S.Ct. 586, 82 L.Ed. 845 (1938) ("If the plaintiff could, no matter how bona fide his original claim in the state court, reduce the amount of his demand to defeat federal jurisdiction the defendant's supposed statutory right of removal would be subject to the plaintiff's caprice."); see also Jones v. Mosher, 107 F. 561, 564 (8th Cir.1901) ("As the right to remove an action which falls within the jurisdiction of the federal courts is a substantial right, the federal courts . . . should be astute not to permit devices to become successful which are used for the very *1215 purpose of destroying that right." (internal citation omitted)).
In this case, the determination of whether the motion to dismiss was an improper forum-shopping measure, by its very nature, called into question the trial court's subject matter jurisdiction. Defendants exercised their right to removal under CAFA, and Thatcher appears to have sought dismissal merely to deprive the federal court of jurisdiction. As a result, determining whether the district court had subject matter jurisdiction was at the crux of the issue of whether the motion to dismiss was being used for the improper purpose of seeking a more favorable forum. The district court erred in failing to take up the jurisdictional question, thereby necessitating remand of this matter. After the trial court determines whether it has subject matter jurisdiction, it can consider whether dismissal without prejudice is appropriate, taking into consideration whether the motion to dismiss is a forum-shopping measure. Alternatively, if the court finds that it does not have subject matter jurisdiction, it should remand to the state court.

III
We find that the district court abused its discretion in granting Thatcher's motion to voluntarily dismiss without first addressing whether the motion was an improper forum-shopping measure. Implicit in this error was the district court's failure to consider subject matter jurisdiction. Therefore, the district court's order dismissing the case without prejudice is reversed. The case is remanded to the district court to conduct proceedings in accordance with this opinion.
