Update to fix problem with writing out log file