correctly return ip addresses for stack