Working example with exception support