Ah, you have the arguments switched. The first argument should get the index, and the second one should get the actual element. I get this switched up all the time, too.