casting intermediate result to a data frame.