nullpointer exception fix