fix scope for switch case