fix template creation