change bufctrl to a sophisticated close chan sender method