Handle edge cases for programmatically switching items on and off