Replace deprecated method pid with id