diff --git a/Solver/function.cpp b/Solver/function.cpp
index 9abe88f1df87b5caf3568fdc4419d5834958566f..ad0b803775089f623ccf3fd85f0bb23ef0ad0bfb 100644
--- a/Solver/function.cpp
+++ b/Solver/function.cpp
@@ -229,7 +229,7 @@ void dataCacheDouble::_eval()
   _valid = true;
 }
 
-dataCacheDouble *dataCacheMap::get(const function *f, dataCacheDouble *caller, bool createIfNotPresent)
+const function * dataCacheMap::_translate(const function *f) const 
 {
   //special case
   if (f == function::getSolution()) {
@@ -257,7 +257,12 @@ dataCacheDouble *dataCacheMap::get(const function *f, dataCacheDouble *caller, b
       Msg::Error ("solution function gradient has not been set");
     }
   }
+  return f;
+}
 
+dataCacheDouble *dataCacheMap::get(const function *f, dataCacheDouble *caller, bool createIfNotPresent)
+{
+  f = _translate(f);
   // do I have a cache for this function ?
   dataCacheDouble *&r = _cacheDoubleMap[f];
   // can I use the cache of my parent ?
@@ -297,8 +302,8 @@ dataCacheDouble *dataCacheMap::get(const function *f, dataCacheDouble *caller, b
       for (std::vector<function::argument>::iterator it = replace->_toReplace.begin();
            it!= replace->_toReplace.end(); it++ ) {
         dataCacheMap *m = rMap->getSecondaryCache(it->iMap);
-        dataCacheDouble *s = new dataCacheDouble(m, (function*)it->f);
-        m->_cacheDoubleMap[it->f] = s;
+        dataCacheDouble *s = new dataCacheDouble(m, (function*)_translate(it->f));
+        m->_cacheDoubleMap[_translate(it->f)] = s;
         replaceCache.toReplace.push_back(s);
       }
       for (std::vector<function::argument>::iterator it = replace->_toCompute.begin();
diff --git a/Solver/function.h b/Solver/function.h
index bff835b5e0235b4c77164245c246de0b8d40be99..f6558a4277cc7f5076a0cb3c704b6f4f3580e664 100644
--- a/Solver/function.h
+++ b/Solver/function.h
@@ -202,6 +202,9 @@ class dataCacheDouble {
 
 class dataCacheMap {
   const function *_functionSolution, *_functionSolutionGradient;
+  //handle function solution and funciton solution gradient
+  //we should get rid of them
+  const function * _translate (const function *) const;
  public:
   dataCacheMap  *_parent;
   std::list<dataCacheMap*> _children;