You didn't show the definition of the variable causing the error, channel.