handle case where data is not a list