Fixed nullpointerexception