update code for delete