Updating the event to prevent default when the modal is closed. Fixes #2