Added mode switching