typo + error handling in example

typo + error handling in example