Fixed issue for tables without primary key