Error handling to getIP()