fixes #4254 Script error raising when loading content tab

Fixed the issue and pushed the code for  review, please check it.