fixed adding eventlistener to be compatible with IE8