Updated how the pid is set.