update example script for latest API changes