add some caching to the on/off functionality