logging still buggy; still trying to find a better solution