add query counter