Fix to close correct channel when finish flag is given in stream