fix example script to be usable with object methods