handle multiple rows in the select output