updated portfolio loading function