handle dataframe as special case