Fixed log loop reading bug