make sure $channels is an arrayref