updated example for exceptions