Index: sansview/perspectives/fitting/basepage.py
===================================================================
--- sansview/perspectives/fitting/basepage.py	(revision 45ed4dad3dbf2b63cc2169bf7541874c42069e47)
+++ sansview/perspectives/fitting/basepage.py	(revision 60d6c238c8eb9ad110edce39d08fa5e5c4fc57f7)
@@ -380,4 +380,5 @@
         return
     
+    
     def read_file(self, path):
         """
Index: sansview/perspectives/fitting/fitpage.py
===================================================================
--- sansview/perspectives/fitting/fitpage.py	(revision 45bf0ede2fb1fbc03ac5c8794b34b4415f800ecb)
+++ sansview/perspectives/fitting/fitpage.py	(revision 60d6c238c8eb9ad110edce39d08fa5e5c4fc57f7)
@@ -536,5 +536,11 @@
                     self.qmax_x = float(self.qmax.GetValue())
                     # return residuals within self.qmin_x and self.qmax_x
-                    x,y,dy = [numpy.asarray(v) for v in (self.data.x,self.data.y,self.data.dy)]
+                    x,y = [numpy.asarray(v) for v in (self.data.x,self.data.y)]
+                    
+                    if self.data.dy==None:
+                        dy= numpy.zeros(len(y))
+                    else:
+                        dy= numpy.asarray(self.data.dy)
+                    dy[dy==0]=1
                     if self.qmin_x==None and self.qmax_x==None: 
                         fx =numpy.asarray([self.model.run(v) for v in x])
Index: sansview/perspectives/fitting/fitting.py
===================================================================
--- sansview/perspectives/fitting/fitting.py	(revision 7c845cbc01c318cbb47a512ad1468742da9afd22)
+++ sansview/perspectives/fitting/fitting.py	(revision 60d6c238c8eb9ad110edce39d08fa5e5c4fc57f7)
@@ -232,4 +232,6 @@
         detector=None
         source=None
+        info = None
+        id=None
         dxl=None
         dxw=None
@@ -242,9 +244,28 @@
         if hasattr(item, "source"):
             source =item.source
+        if hasattr(item ,"info"):
+            info= item.info
+        if hasattr(item,"id"):
+            id = item.id
         from sans.guiframe import dataFitting 
-        data= dataFitting.Data1D(x=item.x, y=item.y, dy=dy, dxl=dxl, dxw=dxw)
-        data.name=item.name
-        data.detector=detector
-        data.source= source
+        if item.__class__.__name__=="Data1D":
+            data= dataFitting.Data1D(x=item.x, y=item.y, dy=dy, dxl=dxl, dxw=dxw)
+        else:
+            data= dataFitting.Theory1D(x=item.x, y=item.y, dxl=dxl, dxw=dxw)
+        data.name = item.name
+        data.detector = detector
+        data.source = source
+        ## allow to highlight data when plotted
+        data.interactive = item.interactive
+        ## when 2 data have the same id override the 1 st plotted
+        data.id = id
+        ## info is a reference to output of dataloader that can be used
+        ## to save  data 1D as cansas xml file
+        data.info= info
+        ## If the data file does not tell us what the axes are, just assume...
+        data.xaxis(item._xaxis,item._xunit)
+        data.yaxis(item._yaxis,item._yunit)
+        ##group_id specify on which panel to plot this data
+        data.group_id = item.group_id
         return data
 
@@ -518,25 +539,7 @@
                         new_model.parameterset[ param_name].set( param_value )
             
-            
             #Do the single fit
             self.fitter.set_model(new_model, self.fit_id, pars)
-            dy=[]
-            x=[]
-            y=[]
-            ## checking the validity of error
-            if metadata.__class__ in  ["Data1D","Theory1D"]:
-                for i in range(len(metadata.dy)):
-                    if metadata.dy[i] !=0:
-                        dy.append(metadata.dy[i])
-                        x.append(metadata.x[i])
-                        y.append(metadata.y[i])
-                if len(dy)>0:        
-                    metadata.dy=numpy.zeros(len(dy))
-                    metadata.dy=dy
-                    metadata.y=numpy.zeros(len(y))
-                    metadata.y=y
-                    metadata.x=numpy.zeros(len(x))
-                    metadata.x=x
-           
+            
             self.fitter.set_data(data=metadata,Uid=self.fit_id,
                                  smearer=smearer,qmin= qmin,qmax=qmax )
@@ -544,5 +547,5 @@
             self.fitter.select_problem_for_fit(Uid= self.fit_id,
                                                value= value.get_scheduled())
-           
+            value.clear_model_param()
         except:
             msg= title +" error: %s" % sys.exc_value
@@ -878,5 +881,5 @@
             if hasattr(data, "group_id"):
                 my_info.group_id= data.group_id
-            
+        
         return my_info
                 
@@ -886,4 +889,5 @@
         """ 
         try:
+            
             new_plot = Theory1D(x=x, y=y)
             my_info = self._get_plotting_info( data)
@@ -894,5 +898,8 @@
             new_plot.xaxis( my_info._xaxis,  my_info._xunit)
             new_plot.yaxis( my_info._yaxis, my_info._yunit)
-            
+            if data!=None:
+                if new_plot.id == data.id:
+                    new_plot.id += "Model"
+         
             # Pass the reset flag to let the plotting event handler
             # know that we are replacing the whole plot
