fixed check_channels() and removed duplicate