Solve javascript Async problem.