Tweak logic for pid lookup