close channel before dying