diff --git a/xs/src/slic3r/GUI/BedShapeDialog.cpp b/xs/src/slic3r/GUI/BedShapeDialog.cpp
index 35238654e..5ee0c1f8b 100644
--- a/xs/src/slic3r/GUI/BedShapeDialog.cpp
+++ b/xs/src/slic3r/GUI/BedShapeDialog.cpp
@@ -312,7 +312,7 @@ void BedShapePanel::load_stl()
 		model = Model::read_from_file(file_name);
 	}
 	catch (std::exception &e) {
-		std::string msg = _L("Error! ") + file_name + " : " + e.what() + ".";
+		auto msg = _L("Error! ") + file_name + " : " + e.what() + ".";
 		show_error(this, msg);
 		exit(1);
 	}