overwrite new pid correctly

Should fix #1