On-line monitoring and active control of dye uptake in dye-sensitised solar cells