Fixed issue with sql using the id instead of nasname to determine if it is an ipaddress