Replaced call with uncaught exception with a call that handles the excep...

...tion