Form for each fieldsets

I’m trying to add a form for each fieldsets as tab , only if passed a bool, I changed the change_form.html file like this.

The problem is that it creates the form in all tabs except the first one, but it creates the csrf token, which means it enters the if, but it fails to create the form I don’t know why.