fix NPE issue