Move Logging out of the try/catch and fix error in logging Fails