delete method, update function