added check to verify scriptcontent is not undefined
Merge branch 'hotfix/v.2.2.4'