Correct placement of nested query

Had the 'nested' value at the wrong level in the query. Tested and fixed.