new version with create_table support