Adding loadScript function