Fix the same issue in the sample code