sample code bug fix