added the check to NVM_DIR