add some functionality and more tests in ChannelTest