fix bug in example code