should this not use `has_rows?(table)` from below?