Advertisement qyery and script updated