fix output
handle data frame as well