any reason not to move this below the logging / `raise_master_error` lines below?