It only indexes if the current item hasn't been on an adult channel. I think line 227 should be below this block, closer to its use.