minor fixes, switch is 100% working