logging bugfixed