diff --git a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
index e6db8eae9b4c8268f4d635b46e9a0da703aa45d4..d5f8e03de31ed9f5e8cd3cacdb5a11d7e8b5a4e0 100644
--- a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
+++ b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
@@ -252,9 +252,10 @@ GCFEvent::TResult MACScheduler::initial_state(GCFEvent& event, GCFPortInterface&
 
 		// Try to connect to the SAS database.
 		ParameterSet* pParamSet = globalParameterSet();
+        std::string username;
         try
         {
-            string username = pParamSet->getString("OTDBusername");
+            username = pParamSet->getString("OTDBusername");
         }
         catch(LOFAR::APSException& ex)
         {
@@ -263,9 +264,10 @@ GCFEvent::TResult MACScheduler::initial_state(GCFEvent& event, GCFPortInterface&
                           << ex.what());
             throw(ex);
         }
+        std::string DBname;
         try
         {
-            string DBname = pParamSet->getString("OTDBdatabasename");
+            DBname = pParamSet->getString("OTDBdatabasename");
         }
         catch(LOFAR::APSException& ex)
         {
@@ -274,9 +276,10 @@ GCFEvent::TResult MACScheduler::initial_state(GCFEvent& event, GCFPortInterface&
                           << ex.what());
             throw(ex);
         }
+        std::string password;
         try
         {
-          string password = pParamSet->getString("OTDBpassword");
+            password = pParamSet->getString("OTDBpassword");
         }
         catch(LOFAR::APSException& ex)
         {
@@ -285,9 +288,10 @@ GCFEvent::TResult MACScheduler::initial_state(GCFEvent& event, GCFPortInterface&
                           << ex.what());
             throw(ex);
         }
+        std::string hostname
         try
         {
-            string hostname = pParamSet->getString("OTDBhostname");
+            hostname = pParamSet->getString("OTDBhostname");
         }
         catch(LOFAR::APSException& ex)
         {
@@ -296,9 +300,10 @@ GCFEvent::TResult MACScheduler::initial_state(GCFEvent& event, GCFPortInterface&
                           << ex.what());
             throw(ex);
         }
+        std::string port;
         try
         {
-            string port = pParamSet->getString("OTDBport");
+            port = pParamSet->getString("OTDBport");
         }
         catch(LOFAR::APSException& ex)
         {