upgrade example to 0.4

manually tested
Merge pull request #218 from chenglou/patch-2

upgrade example to 0.4