added method for obtaining ipv4 address