add error fallback for modal links (default href) and only hide modal elements, not parent page.