Fixed race-condition (Logging)