NullPointerException fix