use tempfile for pipe, avoiding pipe deadlock child issue