fixes error on deleting portfolios. fixes #66