added correct handling for nonautoincrement primary keys