Replace deprecated method pid with id

should be `obj.id`?