auto increment pid functionality in newPortfolio function added