Added uncaught exeption handler
Added test example