fix a bug of making data frames