handle deleted records