Index: sansview/perspectives/fitting/fitpanel.py
===================================================================
--- sansview/perspectives/fitting/fitpanel.py	(revision 8897d662f0aa01fb79e2917447f7606044c30569)
+++ sansview/perspectives/fitting/fitpanel.py	(revision 9b187350a27b63e0f6acf1eba38d6f445fbe7eae)
@@ -187,13 +187,6 @@
         self.Bind(basepage.EVT_NEXT_STATE, self._onRedo)
         
-        #add default page
-        from hint_fitpage import HintFitPage
-        self.hint_page = HintFitPage(self) 
-        self.AddPage(page=self.hint_page, caption="Hint")
-        
-        
-            
-        #Add the first fit page
-        self.add_empty_page()
+        #add default pages
+        self.add_default_pages()
         
         # increment number for model name
@@ -203,4 +196,17 @@
         self.Center()
         
+    def add_default_pages(self):
+        """
+        Add default pages such as a hint page and an empty fit page
+        """
+        #add default page
+        from hint_fitpage import HintFitPage
+        self.hint_page = HintFitPage(self) 
+        self.AddPage(page=self.hint_page, caption="Hint")
+         
+        #Add the first fit page
+        self.add_empty_page()
+
+    
     def close_all(self):
         """
@@ -241,4 +247,13 @@
                     panel.reset_page(state=state)
                     
+    def clear_panel(self, format='.svs'):
+        """
+        Clear and close all panels, used by guimanager
+        """
+        if format == '.svs':
+            #close all panels only when svs file opened
+            self.close_all()
+            self.manager.mypanels = []
+                       
     def on_close_page(self, event=None):
         """
@@ -438,5 +453,5 @@
             panel = self.add_page(page_info=page_info)
             return panel
-    
+        
     def  _onGetstate(self, event):
         """
Index: sansview/perspectives/fitting/fitting.py
===================================================================
--- sansview/perspectives/fitting/fitting.py	(revision 3eb28113af66778958113a38fd758d4ee8be4b0a)
+++ sansview/perspectives/fitting/fitting.py	(revision 9b187350a27b63e0f6acf1eba38d6f445fbe7eae)
@@ -261,5 +261,5 @@
         loader.associate_file_reader(".fitv", self.state_reader)
         loader.associate_file_reader(".svs", self.state_reader)
-        self.format = None
+
         #Send the fitting panel to guiframe
         self.mypanels.append(self.fit_panel)
@@ -295,5 +295,5 @@
         pass
     
-    def set_state(self, state, datainfo=None, format=None):
+    def set_state(self, state, datainfo=None):
         """
         Call-back method for the fit page state reader.
@@ -302,5 +302,4 @@
         : param state: PageState object
         : param datainfo: data
-        : param format: file extension in lower case with dot in front
         """
         # store fitting state in temp_state
@@ -308,6 +307,4 @@
         # index to start with for a new set_state
         self.state_index = 0
-        #file format (extension of the file) opened
-        self.format = format
 
     def  on_set_state_helper(self,event=None):
@@ -315,13 +312,12 @@
         Set_state_helper. This actually sets state after plotting data from state file.
         
-        : event: FitStateUpdateEvent called by plot_data from guiframe, data_loader
+        : event: FitStateUpdateEvent called by dataloader.plot_data from guiframe
         """
         if self.temp_state == None or len(self.temp_state) == 0:
+            if self.state_index==0 and len(self.mypanels) <= 0:
+                self.fit_panel.add_default_pages()
             return
         
         try:
-            #close all panels only when svs file opened
-            if self.format == '.svs':
-                self.fit_panel.close_all()
             # Load fitting state
             state = self.temp_state[self.state_index]
@@ -333,11 +329,13 @@
                 #just set data because set_state won't work
                 page_info = self.fit_panel.get_page_info(data=state.data)
-                self.fit_panel.add_page(page_info)
+                panel = self.fit_panel.add_page(page_info)
+                self.store_page(page=panel, data=state.data)
                 
-            # get ready for the next set state
+            # get ready for the next set_state
             self.state_index += 1
-            
+
             #reset state variables to default when all set_state is finished. 
             if len(self.temp_state) == self.state_index:
+                
                 self.temp_state = []
                 # Make sure the user sees the fitting panel after loading
@@ -345,5 +343,4 @@
         except:
             self.temp_state = []
-            self.format = None 
             raise
                  
Index: sansview/perspectives/fitting/pagestate.py
===================================================================
--- sansview/perspectives/fitting/pagestate.py	(revision 8897d662f0aa01fb79e2917447f7606044c30569)
+++ sansview/perspectives/fitting/pagestate.py	(revision 9b187350a27b63e0f6acf1eba38d6f445fbe7eae)
@@ -1158,5 +1158,5 @@
                     state.data.group_id = name
                     #store state in fitting
-                    self.call_back(state=state, datainfo=output[ind], format=extension.lower())
+                    self.call_back(state=state, datainfo=output[ind])
                     
                 return output
