Updates switch case function