Updated scripts to use pid.