Switched to a buffered approach for stdout and stderr