modify the db and the delete function