Fix dynamic form by bringing back old code

This PR fixes dynamic form feature broken after #207 
Just restoring related old code, to make quick fix.

Ready to merge.