implemented catch for on/off events