diff --git a/main.inc.php b/main.inc.php
index 4f4b01bfbe404fad9b44767eaa4b49acb9755360..026e440ca84cc904d8a5ebcf8e6b5101cd81d41e 100644
--- a/main.inc.php
+++ b/main.inc.php
@@ -43,4 +43,12 @@ $_POST=Format::strip_slashes($_POST);
 $_GET=Format::strip_slashes($_GET);
 $_REQUEST=Format::strip_slashes($_REQUEST);
 }
+
+// extract system messages
+$errors = array();
+$msg=$warn=$sysnotice='';
+if ($_SESSION['::sysmsgs']) {
+    extract($_SESSION['::sysmsgs']);
+    unset($_SESSION['::sysmsgs']);
+}
 ?>
diff --git a/scp/staff.inc.php b/scp/staff.inc.php
index 9330717e3dc86bc495d8b22e0b0c2066001247a9..d4399c74b8fa94f9e049c84bf4be855c1d44df66 100644
--- a/scp/staff.inc.php
+++ b/scp/staff.inc.php
@@ -110,9 +110,6 @@ $_SESSION['TZ_DST']=$thisstaff->observeDaylight();
 
 define('PAGE_LIMIT', $thisstaff->getPageLimit()?$thisstaff->getPageLimit():DEFAULT_PAGE_LIMIT);
 
-//Clear some vars. we use in all pages.
-$errors=array();
-$msg=$warn=$sysnotice='';
 $tabs=array();
 $submenu=array();
 $exempt = in_array(basename($_SERVER['SCRIPT_NAME']), array('logout.php', 'ajax.php', 'logs.php', 'upgrade.php'));