refactor submit handling within modal to account for dynamically added forms