protection against nil strings and limit the number of rows to 10