changes for nullpointerexception