update the sample code