fix error of not displaying modal second time