Fixed an error handling in the channel