fixed code, remember break statements in the switch case