now rendering subqueries correctly