Use a more reliable way of determining the portfolio ids.