Added final Catch Exception to handle any uncaught exceptions.