Added importform that passes back input to function
Refactored closeModals code into own function