Only define global templateSharedObjects if not defined