fix AND queries