update resource method