chained queries working but not yet one size fits all