Index: invariantview/perspectives/invariant/invariant.py
===================================================================
--- invariantview/perspectives/invariant/invariant.py	(revision 27f3831d873b892f6463e9312426563f00511d5d)
+++ invariantview/perspectives/invariant/invariant.py	(revision 75fbd1798f95ec58502a817f7435b1dfae03b69f)
@@ -27,5 +27,5 @@
 from DataLoader.loader import Loader
 from .invariant_panel import InvariantPanel
-from sans.guiframe.events import EVT_INVSTATE_UPDATE
+#from sans.guiframe.events import EVT_INVSTATE_UPDATE
 
 from sans.guiframe.plugin_base import PluginBase
@@ -82,5 +82,5 @@
         #add error back to the data
         self.parent.Bind(ERR_DATA, self._on_data_error)
-        self.parent.Bind(EVT_INVSTATE_UPDATE, self.on_set_state_helper)
+        #self.parent.Bind(EVT_INVSTATE_UPDATE, self.on_set_state_helper)
         
         self.invariant_panel = InvariantPanel(parent=self.parent)
@@ -195,7 +195,7 @@
                 data = dlg.get_data()
                 if issubclass(data.__class__, LoaderData1D):
-                    self.compute_helper(data_list[0])
                     wx.PostEvent(self.parent, NewPlotEvent(plot=data_list[0],
                                                title=data_list[0].title))
+                    self.compute_helper(data_list[0])
                 else:    
                     msg = "invariant cannot be computed for data of "
@@ -205,7 +205,7 @@
         elif len(data_list) == 1:
             if issubclass(data_list[0].__class__, LoaderData1D):
-                self.compute_helper(data_list[0])
                 wx.PostEvent(self.parent, NewPlotEvent(plot=data_list[0],
                                                title=data_list[0].title))
+                self.compute_helper(data_list[0])
             else:
                 msg = "invariant cannot be computed for"
@@ -245,5 +245,5 @@
             raise RuntimeError, msg
 
-    def set_state(self, state, datainfo=None):    
+    def set_state(self, state=None, datainfo=None):    
         """
         Call-back method for the state reader.
@@ -254,29 +254,35 @@
         self.temp_state = None
         try:
-            
-            if datainfo is None:
+            if datainfo.__class__.__name__ == 'list':
+                data = datainfo[0]
+            if data is None:
                 msg = "invariant.set_state: datainfo parameter cannot"
                 msg += " be None in standalone mode"
                 raise RuntimeError, msg
             
-            name = datainfo.meta_data['invstate'].file
-            datainfo.meta_data['invstate'].file = name
-            datainfo.name = name
-            datainfo.filename = name
-            self.__data = datainfo
-            self.__data.group_id = datainfo.filename
-            self.__data.id = datainfo.filename
-
-            temp_state = copy.deepcopy(state)
+            name = data.meta_data['invstate'].file
+            data.meta_data['invstate'].file = name
+            data.name = name
+            data.filename = name
+            #datainfo = self.parent.create_gui_data(datainfo,None)
+            #self.__data = datainfo
+            #self.__data.group_id = data.filename
+            #self.__data.id = datainfo.filename
+            self.__data = data
+            wx.PostEvent(self.parent, NewPlotEvent(plot=self.__data,
+                                        reset=True, title=self.__data.title))
+            #temp_state = copy.deepcopy(state)
+            temp_state = self.state_reader.get_state()
             # set state
             self.invariant_panel.is_state_data = True
             
             # Make sure the user sees the invariant panel after loading
-            self.parent.set_perspective(self.perspective)
+            #self.parent.set_perspective(self.perspective)
+            self.on_perspective(event=None)
             # Load the invariant states
             self.temp_state = temp_state
-            #self.invariant_panel.set_state(state=temp_state,data=self.__data)         
-            
-        except:
+            self.invariant_panel.set_state(state=temp_state,data=self.__data)         
+           
+        except: 
             logging.error("invariant.set_state: %s" % sys.exc_value)
             
Index: invariantview/perspectives/invariant/invariant_state.py
===================================================================
--- invariantview/perspectives/invariant/invariant_state.py	(revision 68d48fa8542d77a3013680d3ded3d74ee2592b83)
+++ invariantview/perspectives/invariant/invariant_state.py	(revision 75fbd1798f95ec58502a817f7435b1dfae03b69f)
@@ -2,5 +2,5 @@
 """
 
-import time
+#import time
 import os
 import sys
@@ -252,4 +252,5 @@
         """
         from xml.dom.minidom import getDOMImplementation
+        import time
         timestamp = time.time()
         # Check whether we have to write a standalone XML file
@@ -319,5 +320,5 @@
         for name, value_list in self.bookmark_list.iteritems():
             element = newdoc.createElement('mark_'+ str(name))
-            _,date,state,comp_state = value_list
+            time,date,state,comp_state = value_list
             time_element = newdoc.createElement('time')
             time_element.appendChild(newdoc.createTextNode(str(value_list[0])))
@@ -643,4 +644,5 @@
         ## CanSAS format flag
         self.cansas = cansas
+        self.state = None
 
     def read(self, path):
@@ -742,11 +744,13 @@
         elif len(output) == 1:
             # Call back to post the new state
-
-            self.call_back(state=output[0].meta_data['invstate'],
-                           datainfo = output[0])
+            self.state = output[0].meta_data['invstate']
+            #self.call_back(state=output[0].meta_data['invstate'],
+            #               datainfo = output[0])
             return output[0]
         else:
             return output                
     
+    def get_state(self):
+        return self.state
     
     def write(self, filename, datainfo=None, invstate=None):
