fixing bug for rows with no sub-rows