use tee to redirect stream to file