Avoid trapping users in the modal if something goes wrong