using loadScript or equivalent function to load dependent library