use tee to redirect stack output