get_ip() logic added