fix criteria for OR queries