Fix build script async issue