fix query_use_count bug