fix tstream exit bug