Fix for primary key attribute

For for wrong primary key check