Fixed string handling by checking the attribute of the dataset