fix switch problem, format pretty