diff --git a/bin/dunecontrol b/bin/dunecontrol
index 908c71177959483dbc1d0f22004e598bca1589f6..2ef938bf124ad636c48c011020f20a88a4b505be 100755
--- a/bin/dunecontrol
+++ b/bin/dunecontrol
@@ -311,7 +311,6 @@ usage () {
 # create the module list
 create_module_list() {
   find_modules_in_path
-  export FOUND_MODULES=$MODULES
   if test "x$MODULE" = "x"; then
 	sort_modules $MODULES
   else
@@ -459,9 +458,7 @@ case "$command" in
     ;;
   export)
     create_module_list
-    if test x. = x$DUNE_CONTROL_PATH; then
-      DUNE_CONTROL_PATH=""
-    fi
+    DUNE_CONTROL_PATH=""
     for mod in $MODULES; do
       if test x != x$DUNE_CONTROL_PATH; then
         export DUNE_CONTROL_PATH="$DUNE_CONTROL_PATH:$(eval echo \$PATH_$mod/dune.module)"
@@ -470,7 +467,10 @@ case "$command" in
       fi
     done
     echo export DUNE_CONTROL_PATH=$DUNE_CONTROL_PATH
-    ;;    
+    ;;
+  unexport)
+	echo export DUNE_CONTROL_PATH=""
+    ;;
   help)
     usage
     ;;
diff --git a/bin/dunemodules.inc b/bin/dunemodules.inc
index 2fcc0854566425426cf51cd76448b19a0f6dd0af..42d857b4e07a09129326ee6cf27c6d3f632e10b0 100644
--- a/bin/dunemodules.inc
+++ b/bin/dunemodules.inc
@@ -78,12 +78,15 @@ parse_control() {
 # search for modules in each directory in DUNE_CONTROL_PATH
 #
 find_modules_in_path() {
-  # foreach dir in $@
-  while read dir; do
-    find_modules $dir
-  done <<EOF
-  $(echo $DUNE_CONTROL_PATH | sed -e 's/:/\n/g') 
+  if test -z "$FOUND_MODULES"; then
+    # foreach dir in $@
+    while read dir; do
+      find_modules $dir
+    done <<EOF
+    $(echo $DUNE_CONTROL_PATH | sed -e 's/:/\n/g') 
 EOF
+  fi
+  export FOUND_MODULES=$MODULES
 }
 
 #