update sample code.