Fix bug when modal import is closed.