Fixes query counter to not be off by 1