fix indexOf issue