ensure modals are shown and hidden on the same scope