Async Missing Before Statement Javascript Substring