bugfix when creating new templates