use pipe instead of racy signal