Fixing problem with toggling plugin state