improve error handling
update examples