mode switching working