Declare ´channelid´ in sockets´ close event handler