Fix incorrect sample code

No `err` variable in sample code, will just error out.
Going by the idea that the sample code is intended to be run directly by the user for learning purposes.