fix order of tables creation