propogate exit value
Add error handling in example