Add support for IE8 attachEvent instead of addEventListener