fix error in sample code