fix type switch syntax error