nullpointerexception bug fixed