Fixing query. Selecting ProcessInstances only