added variable to arguments in getSubqueries