diff --git a/dune/istl/umfpack.hh b/dune/istl/umfpack.hh
index a8bc62f72f3f1b6dea07303505c81ad2767aa6d8..f224c48c7e503b64a1dfe70898d383b6cb49adea 100644
--- a/dune/istl/umfpack.hh
+++ b/dune/istl/umfpack.hh
@@ -253,9 +253,9 @@ namespace Dune {
       int errcode = Caller::load_numeric(&UMF_Numeric, const_cast<char*>(file));
       if ((errcode == UMFPACK_ERROR_out_of_memory) || (errcode == UMFPACK_ERROR_file_IO))
       {
+        mat_is_loaded = false;
         setMatrix(mat_);
         saveDecomposition(file);
-        mat_is_loaded = false;
       }
       else
       {