fixed crash when creating an entity template