Added callback function for the channel close event