fix for java.lang.NullPointerException