Update delete

Update the delete function to ensure working