Fixing toggle bug