fix switch level crash