fix a bug when importing a dataframe into a sql database