Fixes check on value exist. Uses the queryBuilder now

| Q                   | A
| ------------------- | ---
| Bug fix?            | Yes
| New feature?        | No
| BC breaks?          | No
| Tests pass?         | Yes
| Scenarios pass?     | N.A.
| Checkstyle issues?  | No
| Changelog updated?  | No
| Fixed tickets       | N.A.
| Doc PR              | N.A.