fix terminate() in Internet Explorer 10