 while @@fetch_status = 0
    begin
         insert into #tmptexts (meta_id, name, text, newtext)
-        select @meta_id, @name, text, '' from texts where meta_id =@meta_id and name = @name
+        select @meta_id, @name, text, '' from texts where meta_id =@meta_id and name = @name and type =0
                
 	
         select @oldtext = substring(text,@start,1000), @length = len(substring(text,@start,1000))
        	from #tmptexts 
-       	where meta_id = @meta_id and name = @name
+       	where meta_id = @meta_id and name = @name 
        	
         update #tmptexts set newtext = @oldtext where meta_id =@meta_id and name = @name        
         

        where meta_id = @meta_id and name = @name                
	update #tmptexts set newtext = replace((select newtext from #tmptexts where meta_id =@meta_id and name = @name),'&aacute;', '')
        where meta_id = @meta_id and name = @name                               


        select @newtext = newtext 


	    SELECT @ptrval = TEXTPTR(text) 
   	    FROM texts
      	    WHERE meta_id = @meta_id and name = @name and type = 0
    
            set @insert_offset = NULL	--A value of NULL appends the new data to the existing data value.
        
