fix bug in example 2