fix event error in safari