can`t use error event to handle errors: it breaks the pipe