fix bugs in sample code