created a channel which will be closed when a connection is closed