Fixed bug in update_ads