fix NPE
fix not-null assertion