Moved brackets to the right spot to make sure not every event is supported by safari