... if defined $result_ref->{'agency_id'} && $result_ref +->{'agency_id'} != 0