modified toggle.ts