Async Missing Before Statement Javascript Substring Function