Foldable input as List or DataTree question.

Hi guys, 

Does anyone know how to properly make a component which can fold and unfold with some additional DataTree or List input? I follow up these two discussions (discussion1 anddiscussion2) and make this example. However, I still have minor bugs.

Whenever I save and reopen the file, I could not unclick the drop down menu to fold the additional input. See pictures below. 

1. When I open the gh file.

2. The input is not folded. 

3. When I click again, additional input is now duplicated with itself. 

Does anyone know how to fix this situation? Any comment will be appreciated. 

I attach the C# file below. Thanks!