minor fix on subquery