fix the sample code