Revert "Replaced deprecated method in example code"

This reverts commit 545cc6b770dd341f4524ac768f290fdb6b5fce6a.