sync with stdout so that output can be piped in realtime