diff --git a/inc/actions.php b/inc/actions.php
index 6d7859b6a2fe3f9a5f3b4b0010a43a2e8191cc60..27aa375150f9889d8e58c5d7181367980cd8fdac 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -476,8 +476,8 @@ function act_export($act){
       $output = p_wiki_xhtml($ID,$REV,false);
       break;
     default:
-      $headers = p_get_metadata($ID,"format $mode");
       $output = p_cached_output(wikiFN($ID,$REV), $mode);
+      $headers = p_get_metadata($ID,"format $mode");
       break;
   }