fixing failed javascript modal