diff --git a/iexcode/instruments/Kappa.py b/iexcode/instruments/Kappa.py
index 73bac38c1136e983e623d252b05baaf3ad56a8a5..3c2490b2c575dcf48a62f228b0d4f8384c748eb7 100644
--- a/iexcode/instruments/Kappa.py
+++ b/iexcode/instruments/Kappa.py
@@ -293,7 +293,7 @@ def folders_kappa(user_name,**kwargs):
     run = kwargs['run']
 
     if kwargs['debug']:
-        print("run,folder,user_name,ioc,ftp: ",run,iex.BL.folder,user_name,iex.BL.ioc,kwargs['ftp'])
+        print("run,folder,user_name,ioc,ftp: ",run,iex.BL.folder,user_name,mda_ioc(),kwargs['ftp'])
     
     # Create User Folder:
     make_user_folders(run,iex.BL.folder,user_name,iex.BL.endstation,ftp=kwargs['ftp'])
@@ -301,7 +301,7 @@ def folders_kappa(user_name,**kwargs):
 
     if kwargs["set_folders"]:
         # Set up MDA folder:
-        folder_mda(run,iex.BL.folder,user_name,iex.BL.prefix,iex.BL.ioc)
+        folder_mda(run,iex.BL.folder,user_name,mda_prefix(),mda_ioc())
 
         # Set up SPEC folder:
         folders_spec(run,iex.BL.folder,user_name)
@@ -339,7 +339,7 @@ def kappa_reset(**kwargs):
     kwargs.setdefault('reset_MPA_ROIs',False)
 
     #resetting the scanRecord
-    print("resetting the scanRecord - "+iex.BL.ioc)
+    print("resetting the scanRecord - "+mda_ioc())
     mda_reset()
 
     #resetting the MPA ROIs
@@ -461,7 +461,7 @@ def _kappa_scan_after_pvs(clear=False,**kwargs):
     kwargs.setdefault('seq_num',10)
     seq_num = kwargs['seq_num']
 
-    scan_ioc = iex.BL.ioc
+    scan_ioc = mda_ioc()
 
     after_scan_pv,after_scan_proc = userStringSeq_pvs(scan_ioc, seq_num)
 
@@ -483,13 +483,13 @@ def _kappa_scan_after_sequence(scan_ioc,scan_dim,**kwargs):
     kwargs.setdefault('scan_dim',1)
     scan_dim = kwargs['scan_dim']
 
-    scan_ioc = iex.BL.ioc
+    scan_ioc = mda_ioc()
 
     #clear and write the after scan user sequence
     after_scan_pv,after_scan_proc = _kappa_scan_after_pvs(clear=True,**kwargs)
     caput(after_scan_pv+".DESC","After Scan")
         
-    scan_pv = iex.BL.ioc+"scan"+str(scan_dim)
+    scan_pv = mda_ioc()+"scan"+str(scan_dim)
 
     ## Put scan record back in absolute mode
     caput(after_scan_pv+".LNK2",scan_pv+".P1AR")
@@ -513,9 +513,9 @@ def _kappa_detector_triggers_sequence(scan_ioc,scan_dim,**kwargs):    # do we ne
     kwargs.setdefault('seq_num',8)
     seq_num=kwargs['seq_num']
 
-    scan_ioc = iex.BL.ioc
+    scan_ioc = mda_ioc()
 
-    detector_triggers_pv,detector_triggers_proc = userStringSeq_pvs(iex.BL.ioc, seq_num)
+    detector_triggers_pv,detector_triggers_proc = userStringSeq_pvs(mda_ioc(), seq_num)
        
     #clear the userStringSeq
     userStringSeq_clear(scan_ioc,seq_num=kwargs['seq_num'])
@@ -556,7 +556,7 @@ def _kappa_snake_userCalc(**kwargs):
     kwargs.setdefault('scan_dim',1)
 
     seq_num=kwargs['seq_num']
-    scan_ioc = iex.BL.ioc
+    scan_ioc = mda_ioc()
     
     userCalc_clear(scan_ioc,seq_num)
     snake_userCalc_pv,snake_userCalc_proc = userCalcs_pvs(scan_ioc, seq_num)
diff --git a/iexcode/instruments/Octupole.py b/iexcode/instruments/Octupole.py
index 6bd38371aa2676320119c2938b022f5f0b5789e7..11f4748346e6769c373c1acb5e05e55c7eab3d28 100644
--- a/iexcode/instruments/Octupole.py
+++ b/iexcode/instruments/Octupole.py
@@ -263,7 +263,7 @@ def folders_Octupole(user_name,**kwargs):
     run = kwargs['run']
 
     if kwargs['debug']:
-        print("run,folder,user_name,ioc,ftp: ",run,iex.BL.folder,user_name,iex.BL.ioc,kwargs['ftp'])
+        print("run,folder,user_name,ioc,ftp: ",run,iex.BL.folder,user_name,mda_ioc(),kwargs['ftp'])
     
     # Create User Folder:
     make_user_folders(run,iex.BL.folder,user_name,iex.BL.endstation_name,ftp=kwargs['ftp'])
@@ -271,7 +271,7 @@ def folders_Octupole(user_name,**kwargs):
 
     if kwargs["set_folders"]:
         # Set up MDA folder:
-        folder_mda(run,iex.BL.folder,user_name,iex.BL.prefix,iex.BL.ioc)
+        folder_mda(run,iex.BL.folder,user_name,mda_prefix(),mda_ioc())
 
     #resetting
     if 'reset':
@@ -298,7 +298,7 @@ def Octupole_reset(**kwargs):
     resets scanRecord, current amplifiers, mono limits and lakeshore
     """
      #resetting the scanRecord
-    print("resetting the scanRecord - "+iex.BL.ioc)
+    print("resetting the scanRecord - "+mda_ioc())
     mda_reset()
            
     #resetting mono and anyother beamline stuff
@@ -385,7 +385,7 @@ def _Octupole_scan_before_sequence(**kwargs):
     kwargs.setdefault('seq_num',9)
     seq_num=kwargs['seq_num']
 
-    scan_ioc = iex.BL.ioc
+    scan_ioc = mda_ioc()
 
     before_scan_pv,before_scan_proc = userStringSeq_pvs(scan_ioc, seq_num)
 
@@ -408,7 +408,7 @@ def _Octupole_scan_after_pvs(clear=False,**kwargs):
     kwargs.setdefault('seq_num',10)
     seq_num = kwargs['seq_num']
 
-    scan_ioc = iex.BL.ioc
+    scan_ioc = mda_ioc()
 
     after_scan_pv,after_scan_proc = userStringSeq_pvs(scan_ioc, seq_num)
 
@@ -429,13 +429,13 @@ def _Octupole_scan_after_sequence(**kwargs):
     kwargs.setdefault('scan_dim',1)
     scan_dim = kwargs['scan_dim']
 
-    scan_ioc = iex.BL.ioc
+    scan_ioc = mda_ioc()
 
     #clear and write the after scan user sequence
     after_scan_pv,after_scan_proc = _Octupole_scan_after_pvs(clear=True,**kwargs)
     caput(after_scan_pv+".DESC","After Scan")
         
-    scan_pv = iex.BL.ioc+"scan"+str(scan_dim)
+    scan_pv = mda_ioc()+"scan"+str(scan_dim)
 
     ## Put scan record back in absolute mode
     caput(after_scan_pv+".LNK2",scan_pv+".P1AR")
@@ -459,9 +459,9 @@ def _Octupole_detector_triggers_sequence(**kwargs):    # do we need to add 29idb
     kwargs.setdefault('seq_num',8)
     seq_num=kwargs['seq_num']
 
-    scan_ioc = iex.BL.ioc
+    scan_ioc = mda_ioc()
 
-    detector_triggers_pv,detector_triggers_proc = userStringSeq_pvs(iex.BL.ioc, seq_num)
+    detector_triggers_pv,detector_triggers_proc = userStringSeq_pvs(mda_ioc(), seq_num)
        
     #clear the userStringSeq
     userStringSeq_clear(scan_ioc,seq_num=kwargs['seq_num'])
@@ -503,7 +503,7 @@ def _Octupole_snake_userCalc(**kwargs):
     kwargs.setdefault('scan_dim',1)
 
     seq_num=kwargs['seq_num']
-    scan_ioc = iex.BL.ioc
+    scan_ioc = mda_ioc()
     
     userCalc_clear(scan_ioc,seq_num)
     snake_userCalc_pv,snake_userCalc_proc = userCalcs_pvs(scan_ioc, seq_num)