user newer API in the example
Merge pull request #806 from tshepang/modernise

user newer API in the example
thank you