fix incorrect setting of pid