changed method for getting IP