use spawn to avoid maxBuffer issues