Properly check for existance of public and private ip addresses