use more universal technique for getting local ip address