added adgroups call to the code