Revert "fixed the example code which was using old api"

This reverts commit cfdf5fb66849c9934b56578495b32735706f3a37.