Uncaught TypeError: e.indexOf is not a function