updating example to latest API