comment

commented out the 'del row' line;  if there is now cursor (e.g. no lines in the table), then row never gets set.  also, it is not imperative to delete this variable