diff --git a/Demo.cpp b/Demo.cpp
index c88d5945177bb9ec6a683511765c5247eab7b649..609ea42b202a524b85938c7773297dd38f94158e 100644
--- a/Demo.cpp
+++ b/Demo.cpp
@@ -325,7 +325,8 @@ int main(int argc, char * argv[])
         //measure time consumption
         clock_t begin = clock();
 
-        fileName =  inputDir + TToolBox::getFileName(frameCounter);
+        //we define the type better to prevent error
+        fileName = std::string(inputDir + TToolBox::getFileName(frameCounter));
 
 //        //check the string
 //        cout <<"open fileName: "<< fileName<<endl;
@@ -336,7 +337,11 @@ int main(int argc, char * argv[])
         cout <<"\t"<<frameCounter<<"\tof \t"<<amountFiles<<"  load file :"<< fileName<<endl;
         //cv::imwrite(convert.str().c_str(), img_output);
         //we open the file
-        img_input = imread(fileName.c_str(), CV_LOAD_IMAGE_COLOR);
+        cv::String fileNameCV(fileName);
+        cout << " d 3: "<< fileName.size()<< " size: "<< fileName<<endl;
+        cout << " d 3: "<< fileNameCV.size()<< " size:"<< fileNameCV.c_str();
+
+        img_input = imread(fileNameCV, CV_LOAD_IMAGE_COLOR);
 
         cout << " e "<<endl;