Changed JavaScript contains() in indexOf()