modify command-tee
function