Make query system not crash, when QID is duplicated