Move the exception handling inside the try