update TDMain, seperate the functionality of create table and run queries