\QueryPath\QueryPath class doesn't exists.

The class QueryPath is not contained in the QueryPath namespace so the full name of the QueryPath class is \QueryPath and not \QueryPath\QueryPath making the first `if` to be always true