Fix can't update record with customized primary key