fixed toggle bug