added affiliate id support