Fixed jobs script. check for pid.