fixed bug in read_df function