added validations and self-loop checks for nfm