rewrite the get local ip address func.