Fixed a bug in the code where the variable advert was not used when working through the ads.