fixed a bug, i was calling indexOf with the wrong parameter