Fund inflows notch up second-best year on record