nullpointer fixes