modify the delete function