Handle closed channel better