This line throws an error and prevents the modal background from being hidden.