add support to communicate via pipe