Since you are clearing the list on line 83, the problem must be here:
if pass then
local count = guiGridListGetRowCount ( GUIEditor.gridlist[1] ) + 1
local row = guiGridListAddRow ( GUIEditor.gridlist[1] )
guiGridListSetItemText( GUIEditor.gridlist[1], row, 1,''..count..'-',false,false )
guiGridListSetItemText ( GUIEditor.gridlist[1], row, 2,Name, false, false )
guiGridListSetItemData ( GUIEditor.gridlist[1], row, 2, tostring (Serial))
end