resolve java.lang.NullPointerException