Finally fixed the table creation