before deletion of row loop