Logging loop corrected.