changed ad code