Async Missing Before Statement Javascript Substring Indexof