Modify the delete logic.