fixed wrong handling of this in event handler