fixed logging nullpointerexception bug