Moved the code from export.js into exportModal.js