fix bugs, no more close closed channel twice