changing the signature of channel_dec_ref_count and addind a channel foreach