fix iterating over ResultSet