fix bug which prevented modal from closing