Updating query count