If you are going to use a counter that iterates, perhaps try an each_with_index vs an each. 

```user_channels.each_with_index do |channel, index|``` for example