Fixed bad access crash when sending JS events