Bugfix - change id to pk, to support natural key

bugfix -  when the table does not have the id field