preserve internal pid counter as a global var
fix: internal pid counting