Fixes TemplateEngine

Fixes a problem when multiple sandboxes were created during runtime.