More code for updateChannel function.