added support for toggling (not 100%  working yet)