fix un-initialized reference
fix NPE