Add check to deal with empty rows