better checking for table type when creating table