move the close to AFTER the p.Kill()