updated action to properly show and hide optional fields between modal save.