Fix sample code bug