fix pid redeclaration bug