fix to NPE reported by jai