Added nullpointerex correction