added ensuring of unique pids