Engineering the outermost layers of TiO2 nanoparticles using in situ Mg doping in a flame aerosol reactor