Bugfix in late declaration of the scriptTemplate