diff --git a/Solver/function.h b/Solver/function.h
index cc9d41a58312d2aa12609dc8e786959484b7f69c..4392469adb96ea649eef2affbd7e9103249ec10a 100644
--- a/Solver/function.h
+++ b/Solver/function.h
@@ -213,7 +213,7 @@ class dataCacheMap {
   int _nbEvaluationPoints;
   std::map<const function*, dataCacheDouble*> _cacheDoubleMap;
   std::set<dataCacheDouble*> _allDataCaches;
-  std::set<dataCacheDouble*> _toInvalidateOnElement;
+  std::vector<dataCacheDouble*> _toInvalidateOnElement;
   MElement *_element;
   dataCacheMap() {
     _functionSolution = _functionSolutionGradient = NULL;
@@ -225,7 +225,7 @@ class dataCacheMap {
   {
     _allDataCaches.insert(data);
     if(invalidatedOnElement)
-      _toInvalidateOnElement.insert(data);
+      _toInvalidateOnElement.push_back(data);
   }
   virtual dgDataCacheMap *asDgDataCacheMap() 
   {
@@ -246,7 +246,7 @@ class dataCacheMap {
   virtual void setElement(MElement *element)
   {
     _element=element;
-    for(std::set<dataCacheDouble*>::iterator it=_toInvalidateOnElement.begin(); 
+    for(std::vector<dataCacheDouble*>::iterator it=_toInvalidateOnElement.begin(); 
         it!= _toInvalidateOnElement.end(); it++) {
       (*it)->_valid=false;
     }