Fixed IE8 issues

Problem with event code