Fix a small bug in sample