make submit_forms_locally more flexible