fix primary key bug