diff --git a/app/otbLSGRM.cxx b/app/otbLSGRM.cxx
index 0c15b64919a847439f0f25b16e3abab7fa5d4ff8..b5dd444238db0afd5ef90225fc164f9688a86894 100644
--- a/app/otbLSGRM.cxx
+++ b/app/otbLSGRM.cxx
@@ -143,14 +143,15 @@ private:
         // If not, we add the separator
         tmpdir.append("/");
         }
-      }
 
-    // Check that the directory exists
-    if (!itksys::SystemTools::FileExists(tmpdir.c_str(),false))
-      {
-      otbAppLogFATAL("The directory " << tmpdir << " does not exist.");
+      // Check that the directory exists
+      if (!itksys::SystemTools::FileExists(tmpdir.c_str(),false))
+        {
+        otbAppLogFATAL("The directory " << tmpdir << " does not exist.");
+        }
+      otbAppLogINFO("Using temporary directory " << tmpdir);
       }
-    otbAppLogINFO("Using temporary directory " << tmpdir);
+
 
     // Return the prefix
     std::string prefix = tmpdir + outbfname;