Adding agent detection and src setting.