hide modals when they are destroyed, otherwise the black backdrop remains but can't be closed