fix NPE in logging