Really fixed the mode switching this time