fix buggy log func