simplified add pid by removing checks
registering pid handled by even handler. Removed add pid from helpers. trimmed down the code