fixed logs function