Fix issue when multiple tables are present