Error handling in getIP