Fixed error when publicIP is undefined