fixed bug with metadata when using from_pandas