Fix buffer

- Add buffer flush when sending to pipe