write terminate rec to fetch stream, close fetch stream