Javascript Create Async Function