Query, script and action updated for advertizement