added functions to get IP address