finally got multimode mode switching to work!