fix sample code bug