automatically add script tag into the main page when using the model subgenerator