nullpointerexception fix