changed updateSound function switch case statement to if else statement