fixed funky bug with switching modes