update the resource