Fixed nullreferenceexception