Index: sansview/perspectives/fitting/fitting.py
===================================================================
--- sansview/perspectives/fitting/fitting.py	(revision 3cd5806375c406cd55c809b2efb82cc2de2531de)
+++ sansview/perspectives/fitting/fitting.py	(revision 75fbd1798f95ec58502a817f7435b1dfae03b69f)
@@ -131,9 +131,5 @@
         #Menu for fitting
         self.menu1 = wx.Menu()
-           #menu for model
-        menu2 = wx.Menu()
-        self.menu_mng.populate_menu(menu2, owner)
-        id2 = wx.NewId()
-        owner.Bind(models.EVT_MODEL,self._on_model_menu)
+        
         #Set park engine
         id3 = wx.NewId()
@@ -156,4 +152,10 @@
         wx.EVT_MENU(owner, id1, self.on_add_sim_page)
        
+        #menu for model
+        menu2 = wx.Menu()
+        self.menu_mng.populate_menu(menu2, owner)
+        id2 = wx.NewId()
+        owner.Bind(models.EVT_MODEL,self._on_model_menu)
+      
         self.fit_panel.set_owner(owner)
         self.fit_panel.set_model_list(self.menu_mng.get_model_list())
@@ -231,5 +233,5 @@
         """
         self.parent = parent
-        self.parent.Bind(EVT_FITSTATE_UPDATE, self.on_set_state_helper)
+        #self.parent.Bind(EVT_FITSTATE_UPDATE, self.on_set_state_helper)
         # Creation of the fit panel
         self.fit_panel = FitPanel(self.parent, -1)
@@ -251,12 +253,12 @@
         #Create reader when fitting panel are created
         self.state_reader = Reader(self.set_state)   
-       
         #append that reader to list of available reader 
         loader = Loader()
         loader.associate_file_reader(".fitv", self.state_reader)
         loader.associate_file_reader(".svs", self.state_reader)
+        from sans.perspectives.calculator.sld_panel import SldPanel
         #Send the fitting panel to guiframe
         self.mypanels.append(self.fit_panel) 
-      
+        self.mypanels.append(SldPanel(parent=self.parent, base=self.parent))
         return self.mypanels
     
@@ -286,5 +288,4 @@
             wx.PostEvent(self.parent, NewPlotEvent(plot=data, 
                                                    title=str(data.title)))
-   
             
     def set_state(self, state=None, datainfo=None, format=None):
@@ -296,4 +297,5 @@
         : param datainfo: data
         """
+        state = self.state_reader.get_state()
         if state != None:
             # store fitting state in temp_state
@@ -305,6 +307,8 @@
         # state file format
         self.sfile_ext = format
-
-    def on_set_state_helper(self,event=None):
+        
+        self.on_set_state_helper(event=None)
+
+    def  on_set_state_helper(self,event=None):
         """
         Set_state_helper. This actually sets state after plotting data from state file.
@@ -325,12 +329,21 @@
             if state.formfactorcombobox != None:
                 #set state
+                data = self.parent.create_gui_data(state.data)
+                data.group_id = state.data.group_id
+                wx.PostEvent(self.parent, NewPlotEvent(plot=data,
+                                        title=data.title))
                 page = self.fit_panel.set_state(state)   
             else:
+                wx.PostEvent(self.parent, NewPlotEvent(plot=data,
+                                        title=data.title))
                 #just set data because set_state won't work
-                page_info = self.fit_panel.get_page_info(data=state.data)
+                data = self.parent.create_gui_data(state.data)
+                data.group_id = state.data.group_id
+                page_info = self.fit_panel.get_page_info(data=data)
                 panel = self.fit_panel.add_page(page_info)
-                self.store_page(page=panel, data=state.data)
+                self.store_page(page=panel, data=data)
                 self.mypanels.append(panel) 
                 
+               
             # get ready for the next set_state
             self.state_index += 1
@@ -342,5 +355,6 @@
                 #self.state_index = 0
                 # Make sure the user sees the fitting panel after loading
-                self.parent.set_perspective(self.perspective) 
+                #self.parent.set_perspective(self.perspective) 
+                self.on_perspective(event=None)
         except:
             self.state_index==0
@@ -1382,11 +1396,8 @@
                 return
             x = data.x
-            
-            if qmin == None :
-                qmin == DEFAULT_QMIN
-
-            if qmax == None:
-                qmax == DEFAULT_QMAX 
-                
+            if qmin == DEFAULT_QMIN :
+                qmin = min(data.x)
+            if qmax == DEFAULT_QMAX:
+                qmax = max(data.x) 
         if not enable1D:
             return 
Index: sansview/perspectives/fitting/pagestate.py
===================================================================
--- sansview/perspectives/fitting/pagestate.py	(revision fb59ed90d8d3e021f0f291a9064098aae148158d)
+++ sansview/perspectives/fitting/pagestate.py	(revision 75fbd1798f95ec58502a817f7435b1dfae03b69f)
@@ -631,4 +631,7 @@
         ## CanSAS format flag
         self.cansas = cansas
+        self.state = None
+    def get_state(self):
+        return self.state
         
     def read(self, path):
@@ -1170,9 +1173,11 @@
                     state.data.group_id = name
                     #store state in fitting
-                    self.call_back(state=state, datainfo=output[ind],format=ext)
+                    #self.call_back(state=state, datainfo=output[ind],format=ext)
+                    self.state= state
                 return output
               
         except:
-            self.call_back(format=ext)
+            #self.call_back(format=ext)
+            self.state= state
             raise
            
