diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp
index 5726a2c7fc31f520694083bb7645f6abf0dea8d3..ed7047ab8ee5a69aa40216dfe0ca1f67c9684b47 100644
--- a/Common/OpenFile.cpp
+++ b/Common/OpenFile.cpp
@@ -338,6 +338,7 @@ int MergeFile(const std::string &fileName, bool warnIfMissing, bool setBoundingB
 #endif
 
   int status = 0;
+
 #if defined(HAVE_ONELAB)
   std::string solver = getSolverForExtension(ext);
   if(solver.size()){
@@ -361,8 +362,13 @@ int MergeFile(const std::string &fileName, bool warnIfMissing, bool setBoundingB
     CTX::instance()->geom.draw = 1;
     return 1;
   }
-  else
 #endif
+
+  if(GModel::current()->getName() == ""){
+    GModel::current()->setFileName(fileName);
+    GModel::current()->setName(SplitFileName(fileName)[1]);
+  }
+
   if(ext == ".stl" || ext == ".STL"){
     status = GModel::current()->readSTL(fileName, CTX::instance()->geom.tolerance);
   }
@@ -499,11 +505,6 @@ int MergeFile(const std::string &fileName, bool warnIfMissing, bool setBoundingB
     }
   }
 
-  if(GModel::current()->getName() == ""){
-    GModel::current()->setFileName(fileName);
-    GModel::current()->setName(SplitFileName(fileName)[1]);
-  }
-
   ComputeMaxEntityNum();
   if(setBoundingBox) SetBoundingBox();
   CTX::instance()->geom.draw = 1;