fixed wrong var in switch case statement