reworking hf_nis logic