add fun to get ipaddr