fix NPE exception