If the party contends that removal was improper, based on any ground other than that the federal district court lacks subject matter jurisdiction, the party may move the district court to remand the case to state court within 30 days after the defendant filed the notice of removal. The district court will grant the motion if it finds that removal was improper. If the district court determines that it lacks subject matter jurisdiction at any time before entry of final judgment, the district court must remand the action to the state court.