Javascript Call Async Function From Sync