query refactor, add OR logic