add try catch in example