Do proper error handling in the example