Fix javascript on IE 8