update example to current API