Ensure modals are disposed properly