Enabled closePortfolio function