update resource.