Changed joinTables to joinResources since you can use subselects.