fix some problems with resources and template isolate