method in switch case