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