nullreferenceexception fix on new condition type