Fix Query validation issue