replacing indexOf with contains