fixed faulty table creation bug