replace startsWith with indexOf