Fix for IE attachEvent scope