fix possible NPE reported by findbugs